.wap-attribute-prices {
    margin: 20px 0;
}

.wap-attribute-group {
    margin-bottom: 15px;
}

.wap-attribute-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}

.wap-attribute-select {
    width: 100%;
    /* max-width: 300px; */
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.wap-attribute-select:focus {
    border-color: #666;
    outline: none;
}


/* Price display styling */
.wap-price-display {
    margin: 20px 0;
    padding: 15px 0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}

.wap-price-wrapper {
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.wap-price-wrapper .woocommerce-Price-amount {
    color: inherit;
}

.price-updated {
    animation: highlight 1s ease-out;
}

@keyframes highlight {
    0% {
        background-color: #fff3cd;
    }

    100% {
        background-color: transparent;
    }
}

/* Swatches styles */
.wap-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.wap-swatch {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.wap-swatch:hover {
    border-color: #999;
    transform: scale(1.05);
}

.wap-swatch.selected {
    border-color: #333;
    box-shadow: 0 0 0 1px #333;
}

/* Color swatches */
.wap-color-swatch {
    width: 40px;
    height: 40px;
    padding: 3px;
}

.wap-swatch-color {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 2px;
}

/* Image swatches */
.wap-image-swatch {
    width: 60px;
    height: 60px;
}

.wap-image-swatch img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wap-swatch-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background-color: #f0f0f0;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 14px;
    color: #666;
}

/* Tooltip */
.wap-swatch-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    white-space: nowrap;
    font-size: 12px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    margin-bottom: 5px;
    pointer-events: none;
    z-index: 10;
}

.wap-swatch-tooltip:after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
}

.wap-swatch:hover .wap-swatch-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Hidden input for swatches */
.wap-swatch-input {
    display: none;
}

/* Image Preview Tooltip */
.wap-image-preview-tooltip {
    position: absolute;
    bottom: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%) scale(0.95);
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    padding: 10px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 99999;
    pointer-events: none;
    min-width: 320px;
    width: 320px;
}

.wap-image-preview-tooltip.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

.wap-image-preview-tooltip img {
    display: block !important;
    width: 300px !important;
    height: auto !important;
    max-height: 400px;
    object-fit: cover;
    border-radius: 4px;
    background: #f9f9f9;
    min-height: 100px;
    margin: 0;
    padding: 0;
}

/* Arrow always pointing down */
.wap-image-preview-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: white;
    z-index: 99999;
}

/* Ensure proper stacking context for swatches */
.wap-swatches {
    position: relative;
    z-index: 1;
}

/* Ensure swatch has proper position context */
.wap-image-swatch {
    position: relative;
    z-index: 1;
}

/* Always show tooltip above the swatch with highest z-index */
.wap-image-preview-tooltip {
    bottom: calc(100% + 15px) !important;
    top: auto !important;
    z-index: 99999 !important;
}

/* Hide tooltip on mobile */
@media (max-width: 768px) {
    .wap-image-preview-tooltip {
        display: none;
        /* Hide tooltips on mobile for simplicity */
    }
}

/* Swatch styles with proper overflow for tooltip */
.wap-image-swatch {
    cursor: pointer;
    position: relative;
    overflow: visible !important;
    /* Allow tooltip to show outside bounds */
    z-index: 1;
}

.wap-color-swatch {
    cursor: pointer;
    position: relative;
    z-index: 1;
}

/* Attribute sections styling */
.wap-attribute-section {
    margin-bottom: 25px;
    padding: 0;
    background: transparent;
    border-radius: 8px;
    border: unset;
}

.wap-attribute-section h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
}

.wap-attribute-section .wap-attribute-group {
    margin-bottom: 15px;
}

.wap-attribute-section .wap-attribute-group:last-child {
    margin-bottom: 0;
}

/* Color guide link styling */
.wap-color-guide-link {
    margin-top: 10px;
    margin-bottom: 20px;
}

.wap-color-guide-link .color-guide-link {
    display: inline-block;
    padding: 8px 16px;
    background: transparent;
    border: solid 1px #b48569;
    color: #b48569;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0;
    font-size: 14px;
    width: 100%;
    transition: background 0.3s ease;
}

.wap-color-guide-link .color-guide-link:hover {
    background: #b48569;
    color: white;
    text-decoration: none;
}

/* Matmenys section specific styles */
.matmenys-selection {
    /* background: #f5f7fa; */
}

/* Kojytes section specific styles */
.kojytes-selection {
    /* background: #fef5f0; */
}

/* Selected value display for image swatches */
.wap-selected-value {
    color: #666;
    font-size: inherit;
    font-weight: normal;
    margin-left: 5px;
}

.wap-selected-value:not(:empty) {
    display: inline !important;
}

.wap-selected-value:not(:empty):before {
    content: ": ";
    color: #333;
}