/* Product Variants Styling for Storefront */

/* Variant Container */
.product-variants {
    margin: 20px 0;
}

.variant-group {
    margin-bottom: 20px;
}

.variant-label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 10px;
    color: var(--primary-text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Dropdown Style Variants */
.variant-select {
    width: 100%;
    padding: 0 20px;
    height: 40px;
    line-height: 40px;
    border: 1px solid #ddd;
    border-radius: 0;
    font-size: 14px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.1s ease;
    font-family: "Poppins", sans-serif;
}

.variant-select:hover {
    border-color: var(--primary-highlight-color);
}

.variant-select:focus {
    outline: none;
    border-color: var(--primary-highlight-color);
    box-shadow: none;
}

/* Tile/Button Style Variants */
.variant-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.variant-option {
    position: relative;
}

.variant-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.variant-option-label {
    display: inline-block;
    padding: 0 20px;
    border: 1px solid #ddd;
    border-radius: 0;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.1s ease;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-text-color);
    min-width: 60px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    user-select: none;
    font-family: "Poppins", sans-serif;
}

.variant-option-label:hover {
    border-color: var(--secondary-text-color);
    background-color: rgba(0, 0, 0, 0.05);
}

.variant-option input[type="radio"]:checked + .variant-option-label {
    border-color: var(--secondary-text-color);
    background-color: var(--secondary-text-color);
    color: #fff;
}

.variant-option input[type="radio"]:disabled + .variant-option-label {
    opacity: 0.4;
    cursor: not-allowed;
    background-color: #f9f9f9;
}

/* Variant Info Messages */
.variant-info {
    margin-top: 15px;
    padding: 10px 15px;
    border-radius: 0;
    font-size: 13px;
    font-family: "Poppins", sans-serif;
}

.variant-info.error {
    background-color: #fff5f5;
    border: 1px solid #ff4444;
    color: #d32f2f;
}

.variant-info.warning {
    background-color: #fffbf0;
    border: 1px solid #ffa726;
    color: #f57c00;
}

.variant-info.success {
    background-color: #f1f8f4;
    border: 1px solid #4caf50;
    color: #2e7d32;
}

/* Selected Variant Display (for cart, checkout) */
.selected-variant {
    font-size: 13px;
    color: var(--secondary-text-color);
    margin-top: 5px;
}

.selected-variant-label {
    font-weight: 600;
    color: var(--primary-text-color);
}

.selected-variant-value {
    color: var(--secondary-text-color);
}

/* Cart Item Variant Display */
.cart-item-variant {
    font-size: 12px;
    color: var(--secondary-text-color);
    margin-top: 3px;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    position: relative;
}

/* Full cart page - allow wrapping for complete variant display */
.wn__cart__area .cart-item-variant {
    white-space: normal;
    max-width: none;
    word-wrap: break-word;
    line-height: 1.5;
}

/* Tooltip for truncated variant text */
.cart-item-variant[title]:hover::after {
    content: attr(title);
    position: absolute;
    left: 0;
    top: 100%;
    background: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    white-space: normal;
    max-width: 300px;
    z-index: 1000;
    font-size: 11px;
    line-height: 1.4;
    margin-top: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .variant-option-label {
        padding: 0 15px;
        font-size: 13px;
        min-width: 50px;
        height: 36px;
        line-height: 36px;
    }
    
    .variant-select {
        padding: 0 15px;
        height: 36px;
        line-height: 36px;
        font-size: 13px;
    }
    
    .variant-label {
        font-size: 13px;
    }
    
    .variant-options {
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .variant-option-label {
        padding: 0 12px;
        font-size: 12px;
        min-width: 45px;
        height: 34px;
        line-height: 34px;
    }
    
    .variant-select {
        padding: 0 12px;
        height: 34px;
        line-height: 34px;
        font-size: 12px;
    }
    
    .variant-options {
        gap: 6px;
    }
}

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

/* Out of Stock Indicator */
.variant-out-of-stock {
    text-decoration: line-through;
    opacity: 0.5;
}

/* Price Display with Variants */
.variant-price-range {
    font-size: 14px;
    color: var(--secondary-text-color);
    margin-top: 5px;
}

.variant-price-from {
    font-weight: 600;
    color: var(--primary-highlight-color);
}

/* Variant combination not available */
.variant-unavailable {
    padding: 10px 15px;
    background-color: #fffbf0;
    border: 1px solid #ffa726;
    border-radius: 0;
    color: #f57c00;
    font-size: 13px;
    margin-top: 10px;
}
