/**
 * Smart Variations - Frontend Styles
 */

/* Modifier Fields Container */
.sv-modifier-fields {
    margin: 15px 0;
    padding: 15px 0;
    border-top: 1px solid #eee;
}

/* Individual Modifier Field */
.sv-modifier-field {
    margin-bottom: 15px;
}

.sv-modifier-field:last-child {
    margin-bottom: 0;
}

.sv-modifier-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.sv-modifier-field select {
    width: 100%;
    max-width: 300px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background-color: #fff;
    font-size: 14px;
    color: #333;
}

.sv-modifier-field select:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 1px #0073aa;
}

/* Modifier Select with Price */
.sv-modifier-select option {
    padding: 5px;
}

/* Calculated Price Display */
.sv-calculated-price {
    margin-top: 15px;
    padding: 10px 15px;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 3px;
}

.sv-calculated-price .sv-price-label {
    font-weight: 600;
    margin-right: 10px;
}

.sv-calculated-price .sv-price-value {
    font-size: 18px;
    font-weight: 700;
    color: #77a464;
}

/* Price Range Display */
.sv-price-range {
    display: inline-block;
}

/* Composite SKU (hidden by default) */
.sv-composite-sku {
    display: none;
}

/* SKU Display (if shown) */
.sv-sku-display {
    margin-top: 10px;
    font-size: 12px;
    color: #666;
}

.sv-sku-display .sv-sku-label {
    font-weight: 600;
}

.sv-sku-display .sv-sku-value {
    font-family: monospace;
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 2px;
}

/* Loading State */
.sv-modifier-fields.sv-loading {
    opacity: 0.6;
    pointer-events: none;
}

.sv-modifier-fields.sv-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ddd;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: sv-spin 0.8s linear infinite;
}

@keyframes sv-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Price Adjustment Indicator */
.sv-price-adjustment {
    display: inline-block;
    margin-left: 5px;
    font-size: 12px;
    color: #666;
}

.sv-price-adjustment.positive {
    color: #d63638;
}

.sv-price-adjustment.negative {
    color: #00a32a;
}

/* Cart Item Modifier Display */
.sv-cart-item-modifiers {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

.sv-cart-item-modifiers dt {
    display: inline;
    font-weight: 600;
}

.sv-cart-item-modifiers dd {
    display: inline;
    margin: 0 10px 0 5px;
}

/* Order Item Modifier Display */
.sv-order-item-modifiers {
    margin-top: 5px;
}

.sv-order-item-modifiers .sv-modifier-item {
    display: block;
    font-size: 12px;
    color: #666;
}

/* Responsive Styles */
@media screen and (max-width: 768px) {
    .sv-modifier-field select {
        max-width: 100%;
    }
    
    .sv-calculated-price {
        text-align: center;
    }
    
    .sv-calculated-price .sv-price-value {
        display: block;
        margin-top: 5px;
    }
}

/* Theme Compatibility - Storefront */
.storefront .sv-modifier-fields {
    margin: 20px 0;
}

.storefront .sv-modifier-field label {
    font-size: 14px;
}

/* Theme Compatibility - Astra */
.ast-woo-shop-archive .sv-price-range,
.ast-single-product .sv-price-range {
    font-size: inherit;
}

/* Theme Compatibility - OceanWP */
.oceanwp-theme .sv-modifier-fields {
    margin: 15px 0;
}

/* Theme Compatibility - Flavor Theme (Custom) */
.flavor-theme .sv-modifier-fields {
    padding: 20px;
    background: #fafafa;
    border-radius: 5px;
}

.flavor-theme .sv-modifier-field select {
    border-radius: 5px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .sv-modifier-fields {
        border-top-color: #444;
    }
    
    .sv-modifier-field label {
        color: #eee;
    }
    
    .sv-modifier-field select {
        background-color: #333;
        border-color: #555;
        color: #eee;
    }
    
    .sv-calculated-price {
        background: #333;
        border-color: #444;
    }
    
    .sv-sku-display .sv-sku-value {
        background: #444;
    }
}
