/**
 * Custom Quick View Styles
 * Enhanced styling for product variations display
 */

/* Custom Modal Styles (not using MagnificPopup) */
#custom-quick-view-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

#custom-quick-view-content {
    background: white;
    border-radius: 12px;
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

#close-quick-view {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    z-index: 10;
}

#close-quick-view:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Hide the add-to-cart button in quick view */
.custom-quick-view .single_add_to_cart_button,
.product-quick-view .single_add_to_cart_button {
    display: none !important;
}

/* Also hide the quantity selector if present */
.custom-quick-view .quantity,
.product-quick-view .quantity {
    display: none !important;
}

/* Quick View Modal Enhancements */
.product-quick-view.custom-quick-view {
    max-width: 1000px !important;
    border-radius: 8px;
}

.product-quick-view .single-product-top {
    display: flex;
    gap: 30px;
    padding: 20px;
}

.product-quick-view .single-product-image-wrap {
    flex: 0 0 50%;
    max-width: 50%;
}

.product-quick-view .single-product-summary {
    flex: 1;
    max-height: 600px;
}

/* Product Images Carousel */
.product-quick-view .slider-for {
    margin-bottom: 15px;
}

.product-quick-view .slider-for .product-image-item {
    background: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-quick-view .slider-for img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    width: 100%;
}

/* Thumbnails */
.product-quick-view .slider-nav {
    margin-top: 10px;
}

.product-quick-view .slider-nav .thumbnail-image {
    padding: 5px;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.product-quick-view .slider-nav .thumbnail-image:hover {
    border-color: #ddd;
}

.product-quick-view .slider-nav .slick-current .thumbnail-image {
    border-color: #000;
}

.product-quick-view .slider-nav .thumbnail-image img {
    border-radius: 4px;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

/* Slick Slider Arrows */
.product-quick-view .slick-arrow {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.product-quick-view .slick-arrow:hover {
    background: #fff;
}

.product-quick-view .slick-prev {
    right: auto;
    left: 10px;
}

.product-quick-view .slick-next {
    left: auto;
    right: 10px;
}

/* Product Title */
.product-quick-view .product_title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.3;
}

/* Price */
.product-quick-view .price {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #000;
}

.product-quick-view .price del {
    opacity: 0.5;
    margin-left: 10px;
    font-size: 18px;
}

/* Variations Table */
.product-quick-view table.variations {
    margin-bottom: 20px;
    width: 100%;
}

.product-quick-view table.variations tr {
    margin-bottom: 20px;
}

.product-quick-view table.variations .label {
    width: 100%;
    margin-bottom: 8px;
}

.product-quick-view table.variations label {
    font-size: 15px;
    font-weight: 600;
    color: #000;
    display: block;
}

.product-quick-view table.variations .value {
    width: 100%;
}

/* Color Variations - Enhanced with Hover Tooltips */
.product-quick-view .color-attribute-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 0 !important;
}

.product-quick-view .color-attribute-wrap > li {
    width: 32px !important;
    height: 32px !important;
    margin: 0 !important;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.product-quick-view .color-attribute-wrap > li:hover {
    transform: scale(1.15);
    z-index: 10;
}

.product-quick-view .color-attribute-wrap > li:before {
    width: 38px !important;
    height: 38px !important;
    top: -3px;
    left: -3px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

/* Hide color name text by default */
.product-quick-view .color-attribute-wrap > li span,
.product-quick-view .color-attribute-wrap > li .tawcvs-swatch-label {
    position: absolute;
    opacity: 0;
    visibility: hidden;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 100;
    margin-bottom: 8px;
}

/* Show tooltip arrow */
.product-quick-view .color-attribute-wrap > li span:after,
.product-quick-view .color-attribute-wrap > li .tawcvs-swatch-label:after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.85);
}

/* Show tooltip on hover */
.product-quick-view .color-attribute-wrap > li:hover span,
.product-quick-view .color-attribute-wrap > li:hover .tawcvs-swatch-label {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Alternative: if color names are in a different element */
.product-quick-view .variations td.value label {
    position: relative;
}

.product-quick-view .variations td.value label .tawcvs-swatch {
    display: inline-block;
}

.product-quick-view .variations td.value label > span:not(.tawcvs-swatch) {
    position: absolute;
    opacity: 0;
    visibility: hidden;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 100;
}

.product-quick-view .variations td.value label:hover > span:not(.tawcvs-swatch) {
    opacity: 1;
    visibility: visible;
}

.product-quick-view .color-attribute-wrap > li.selected:before,
.product-quick-view .color-attribute-wrap > li:hover:before {
    border-color: #000 !important;
}

/* Size/Label Variations - Enhanced */
.product-quick-view .label-attribute-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 0 !important;
}

.product-quick-view .label-attribute-wrap > li {
    background: #f5f5f5;
    border: 2px solid #e0e0e0 !important;
    border-radius: 6px;
    padding: 10px 16px !important;
    min-width: 50px;
    height: 42px !important;
    line-height: 18px !important;
    font-size: 14px !important;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 !important;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-quick-view .label-attribute-wrap > li:hover {
    background: #fff;
    border-color: #999 !important;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.product-quick-view .label-attribute-wrap > li.selected {
    background: #000 !important;
    border-color: #000 !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.product-quick-view .label-attribute-wrap > li.haru-li-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.product-quick-view .label-attribute-wrap > li.haru-li-disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Tooltip */
.product-quick-view .button-tooltip {
    background: #333;
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.product-quick-view .button-tooltip:after {
    border-top-color: #333;
}

/* Reset Variations Link */
.product-quick-view .reset_variations {
    font-size: 13px;
    color: #666;
    text-decoration: underline;
    transition: all 0.3s ease;
}

.product-quick-view .reset_variations:hover {
    color: #000;
}

/* Quantity & Add to Cart */
.product-quick-view .quantity {
    margin-left: 0;
    margin-bottom: 15px;
}

.product-quick-view .quantity input {
    width: 80px;
    height: 48px;
    text-align: center;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
}

.product-quick-view .single_add_to_cart_button {
    width: 100%;
    height: 52px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 6px;
    background: #f50057;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-quick-view .single_add_to_cart_button:hover {
    background: #c51162;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 0, 87, 0.3);
}

/* Variation Description */
.product-quick-view .woocommerce-variation-description {
    margin-bottom: 15px;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.6;
}

/* Variation Price */
.product-quick-view .woocommerce-variation-price {
    margin-bottom: 15px;
}

.product-quick-view .woocommerce-variation-price .price {
    font-size: 24px;
    color: #f50057;
}

/* Variation Availability */
.product-quick-view .woocommerce-variation-availability .stock {
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 15px;
}

.product-quick-view .woocommerce-variation-availability .stock.in-stock {
    background: #e8f5e9;
    color: #2e7d32;
}

.product-quick-view .woocommerce-variation-availability .stock.out-of-stock {
    background: #ffebee;
    color: #c62828;
}

/* Selected Value Display */
.product-quick-view .selected-value {
    display: inline-block;
    margin-right: 8px;
    color: #f50057;
    font-weight: 600;
}

/* Close Button */
.mfp-quick-view .mfp-close {
    width: 44px;
    height: 44px;
    opacity: 1;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 50%;
    top: -50px;
    right: 0;
}

.mfp-quick-view .mfp-close:hover {
    background: #000;
}

/* Responsive */
@media (max-width: 768px) {
    .product-quick-view.custom-quick-view {
        max-width: 95%;
        margin: 10px auto;
    }
    
    .product-quick-view .single-product-top {
        flex-direction: column;
        gap: 20px;
        padding: 15px;
    }
    
    .product-quick-view .single-product-image-wrap {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .product-quick-view .product_title {
        font-size: 20px;
    }
    
    .product-quick-view .price {
        font-size: 18px;
    }
    
    .product-quick-view .color-attribute-wrap {
        gap: 10px;
    }
    
    .product-quick-view .color-attribute-wrap > li {
        width: 28px !important;
        height: 28px !important;
    }
    
    .product-quick-view .label-attribute-wrap {
        gap: 6px;
    }
    
    .product-quick-view .label-attribute-wrap > li {
        padding: 8px 12px !important;
        min-width: 44px;
        font-size: 13px !important;
        height: 38px !important;
    }
}

/* Wider screens - show more variations per row */
@media (min-width: 769px) {
    .product-quick-view .label-attribute-wrap {
        max-width: 100%;
    }
    
    .product-quick-view .label-attribute-wrap > li {
        flex: 0 0 auto;
    }
}

/* RTL Support */
[dir="rtl"] .product-quick-view .single-product-top {
    direction: rtl;
}

[dir="rtl"] .product-quick-view .slider-for,
[dir="rtl"] .product-quick-view .slider-nav {
    direction: ltr;
}

[dir="rtl"] .product-quick-view .price del {
    margin-left: 0;
    margin-right: 10px;
}

[dir="rtl"] .product-quick-view .label-attribute-wrap,
[dir="rtl"] .product-quick-view .color-attribute-wrap {
    direction: rtl;
}

[dir="rtl"] .product-quick-view table.variations label {
    text-align: right;
}

[dir="rtl"] .product-quick-view .reset_variations:before {
    margin-right: 0;
    margin-left: 5px;
}

/* Loading State */
.product-quick-view .variations_form.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Ensure Slick Slides are Visible */
.product-quick-view .slick-slide {
    opacity: 1 !important;
    visibility: visible !important;
}

.product-quick-view .slick-track {
    display: flex;
    align-items: center;
}

