/**
 * Wallribbon Configurator Styles
 */

/* Hide WooCommerce placeholder */
.woocommerce-product-gallery__image--placeholder {
    display: none !important;
}

/* Hide default WooCommerce price (not our configurator price) */
.summary > p.price {
    display: none !important;
}

/* Gallery Preview Container — hidden on load, shown via JS when user selects options */
.wrc-gallery-preview {
    display: none;
    margin-bottom: 20px;
}

.wrc-preview-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: #f8f8f8;
    border-radius: 8px;
    overflow: hidden;
    cursor: zoom-in;
}

.wrc-preview-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.15s ease-out;
    transform-origin: center center;
}

.wrc-preview-mat {
    z-index: 1;
}

.wrc-preview-wood {
    z-index: 2;
}

/* Configurator Fields Container */
.wrc-configurator-fields {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
}
.wrc-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wrc-field label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.wrc-field label .required {
    color: #e74c3c;
}

.wrc-select {
    width: 100%;
    padding: 12px 15px;
    font-size: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wrc-select:hover {
    border-color: #bbb;
}

.wrc-select:focus {
    outline: none;
    border-color: #333;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

.wrc-select:invalid {
    color: #999;
}

/* Mat Color Circles */
.wrc-mat-circles {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 4px 0;
}

.wrc-mat-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #ddd;
    cursor: pointer;
    padding: 0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    flex-shrink: 0;
}

.wrc-mat-circle:hover {
    border-color: #999;
    transform: scale(1.1);
}

.wrc-mat-circle.wrc-selected {
    border-color: #333;
    box-shadow: 0 0 0 2px #333;
}

.wrc-mat-circle:focus {
    outline: none;
    border-color: #333;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

/* Validation Error State */
.wrc-field-error {
    border: 1px solid #e74c3c;
    border-radius: 4px;
    padding: 4px;
}

.wrc-select.wrc-field-error {
    border-color: #e74c3c;
    padding: 12px 15px;
}

/* Selection Summary */
.wrc-summary {
    padding: 8px 0;
    font-size: 16px;
    color: #555;
    line-height: 1.4;
}

/* Price Display — WooCommerce-native style */
.wrc-price-display {
    margin-top: 5px;
}

.wrc-price-display .price {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    display: flex !important;
    align-items: center;
    gap: 8px;
}

.wrc-price-sale,
.wrc-price-regular {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.wrc-price-display .price del {
    opacity: 0.5;
    font-size: 18px;
    font-weight: 400;
}

.wrc-price-display .price ins {
    text-decoration: none;
    color: #333;
}

/* SKU Display */
.wrc-sku {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: #fff;
    border: 1px dashed #ddd;
    border-radius: 4px;
    font-family: monospace;
}

.wrc-sku-label {
    font-size: 13px;
    color: #666;
}

.wrc-sku-value {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

/* Loading State */
.wrc-loading {
    position: relative;
    pointer-events: none;
}

.wrc-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 10;
}

/* Responsive */
@media (max-width: 768px) {
    .wrc-configurator-wrapper {
        flex-direction: column;
        gap: 20px;
    }

    .wrc-preview {
        flex: none;
        max-width: 100%;
    }

    .wrc-preview-container {
        max-width: 300px;
        margin: 0 auto;
    }

    .wrc-select {
        padding: 14px 15px;
        font-size: 16px; /* Prevent iOS zoom */
    }
}

/* Cart Item Display */
.woocommerce-cart-form .wrc-item-meta {
    font-size: 13px;
    color: #666;
}

.woocommerce-cart-form .wrc-item-meta dt {
    float: left;
    clear: left;
    margin-right: 5px;
    font-weight: 600;
}

.woocommerce-cart-form .wrc-item-meta dd {
    margin: 0 0 5px 0;
}

/* Animations */
@keyframes wrc-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.wrc-preview-layer.wrc-visible {
    animation: wrc-fade-in 0.3s ease forwards;
}
