/**
 * Advanced Quick View - Main Styles (Quick View Popup)
 * Version: 2.1.0
 */

/* Quick View Trigger Button (on product archive) */
.product .quick-view-button.aqv-quick-view-trigger {
    display: none;
    position: absolute;
    /* top, left, transform will be set by inline style from aqv_generate_quick_view_button_html */
    background-color: transparent;
    border: none;
    cursor: pointer;
    z-index: 10;
    transition: opacity 0.2s ease, transform 0.2s ease;
    padding: 5px;
    line-height: 0;
}

.woocommerce ul.products li.product:hover .quick-view-button.aqv-quick-view-trigger {
    display: block;
    opacity: 0.85; /* Slightly transparent until hovered directly */
}
.quick-view-button.aqv-quick-view-trigger:hover {
    opacity: 1;
}

.quick-view-button.aqv-quick-view-trigger svg.quick-view-icon {
    fill: #A1EF8B; /* Light Green - Brand Guideline */
    width: 30px;
    height: 30px;
    transition: fill 0.2s ease, transform 0.2s ease;
}

.quick-view-button.aqv-quick-view-trigger:hover svg.quick-view-icon {
    fill: #8C8CEA; /* Vista Blue - Brand Guideline */
    transform: scale(1.1);
}


/* Loading Overlay */
.loading-overlay.aqv-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(247, 245, 255, 0.88); /* Magnolia with opacity - Brand Guideline */
    z-index: 100000; /* Very high z-index */
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2.5px);
}

.loading-overlay.aqv-loading-overlay .spinner.aqv-spinner {
    border: 5px solid rgba(140, 140, 234, 0.25); /* Vista Blue transparent - Brand Guideline */
    border-top-color: #8C8CEA; /* Vista Blue Solid - Brand Guideline */
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: aqvMainSpinKeyframes 0.75s linear infinite;
}

@keyframes aqvMainSpinKeyframes {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Popup Overlay */
.popup-overlay.aqv-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 51, 49, 0.78); /* State Green with opacity - Brand Guideline */
    z-index: 99990;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px; /* Padding for smaller screens */
    box-sizing: border-box;
    overflow-y: auto;
}

/* Quick View Popup */
.quick-view-popup.aqv-quick-view-popup {
    background: #FFFFFF;
    border: 1px solid #AABADA; /* Light Steel Blue - Brand Guideline */
    border-radius: 5px;
    width: 92%;
    max-width: 960px;
    display: flex;
    flex-direction: column; /* Mobile first: stack vertically */
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 35px rgba(0,0,0,0.2);
    animation: aqvPopupFadeInAnimationKeyframes 0.3s ease-out;
    max-height: calc(100vh - 40px); /* Ensure popup fits in viewport with some margin */
}

@keyframes aqvPopupFadeInAnimationKeyframes {
    from { opacity: 0; transform: translateY(15px) scale(0.99); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.aqv-close-popup {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 26px;
    font-weight: bold;
    color: #8C8CEA; /* Vista Blue - Brand Guideline */
    background: rgba(247, 245, 255, 0.6); /* Magnolia transparent - Brand Guideline */
    border-radius: 50%;
    width: 32px;
    height: 32px;
    line-height: 30px;
    text-align: center;
    cursor: pointer;
    z-index: 105; /* Ensure it's above all content in the popup's right panel */
    transition: all 0.2s ease-in-out;
    border: 1px solid transparent;
}

.aqv-close-popup:hover {
    color: #FFFFFF;
    background-color: #5A7AED; /* Blueberry - Brand Guideline */
    transform: rotate(180deg) scale(1.05);
    border-color: #5A7AED;
}

/* Popup Layout: Left (Image) & Right (Content) */
.aqv-popup-left, .aqv-popup-right {
    padding: 15px; /* Base padding */
    box-sizing: border-box;
}

.aqv-popup-left {
    width: 100%;
    position: relative;
    background-color: #F7F5FF; /* Magnolia - Brand Guideline */
}

.aqv-popup-right {
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Allows scrolling for content */
    max-height: calc(90vh - 300px); /* Adjust based on typical image height */
}


@media (min-width: 768px) { /* Tablet and above */
    .quick-view-popup.aqv-quick-view-popup {
        flex-direction: row;
        max-height: 85vh; /* Can be a bit taller on desktop */
    }
    .aqv-popup-left {
        width: 45%; /* As per original structure for desktop */
        border-right: 1px solid #AABADA; /* Light Steel Blue separator - Brand Guideline */
        padding: 20px;
        max-height: none; /* Height will be constrained by parent */
    }
    .aqv-popup-right {
        width: 55%;
        padding: 20px 25px;
        max-height: none; /* Height will be constrained by parent */
    }
}

/* Image Zoom */
.aqv-zoom-container {
    overflow: hidden; position: relative; width: 100%;
    min-height: 280px; display: flex; align-items: center; justify-content: center;
}
img.aqv-zoom-image {
    display: block; width: 100%; height: auto;
    max-height: 480px; /* Max image height in popup */
    object-fit: contain; transition: transform 0.18s ease-out; cursor: zoom-in;
}
img.aqv-zoom-image.zoom-active { transform: scale(1.65); } /* Increased zoom */

/* Swiper Styles */
.aqv-swiper-container { width: 100%; height: 100%; }
.aqv-swiper-container .swiper-button-next,
.aqv-swiper-container .swiper-button-prev {
    color: #FFFFFF; background-color: rgba(140, 140, 234, 0.65); /* Vista Blue semi-transparent */
    border-radius: 50%; width: 34px; height: 34px; transition: background-color 0.2s ease;
}
.aqv-swiper-container .swiper-button-next:hover,
.aqv-swiper-container .swiper-button-prev:hover { background-color: #5A7AED; } /* Blueberry */
.aqv-swiper-container .swiper-button-next::after,
.aqv-swiper-container .swiper-button-prev::after { font-size: 13px; }

.aqv-swiper-container .swiper-pagination { bottom: 12px !important; } /* Ensure pagination is visible */
.aqv-swiper-container .swiper-pagination-bullet {
    background: #AABADA; opacity: 0.7; width: 8px; height: 8px; /* Light Steel Blue */
    transition: background-color 0.2s ease, transform 0.2s ease;
}
.aqv-swiper-container .swiper-pagination-bullet:hover { transform: scale(1.15); }
.aqv-swiper-container .swiper-pagination-bullet-active { background: #8C8CEA; transform: scale(1.05); } /* Vista Blue */

/* Product Info in Popup */
h2.aqv-product-title {
    font-size: 1.5em; /* Merriweather Sans for titles */
    margin: 0 0 8px 0;
    color: #053331; /* State Green - Brand Guideline */
    line-height: 1.25;
    font-family: 'Merriweather Sans', sans-serif;
    padding-right: 35px; /* Space for close button to avoid overlap */
    position: relative; /* For stacking context if needed, though padding should suffice */
    z-index: 1; /* Ensure title is below close button if absolutely positioned */
}
.aqv-product-price { font-size: 1.3em; margin-bottom: 12px; color: #053331; font-weight: 600; }
.aqv-product-price del { color: #757575; font-size: 0.8em; margin-right: 6px; }
.aqv-product-price ins { color: #5A7AED; text-decoration: none; } /* Blueberry */

.aqv-rating { margin-bottom: 12px; }
.aqv-rating .star-rating { font-size: 1em; }
.aqv-stock-status { font-size: 0.9em; margin-bottom: 12px; font-style: italic; color: #1C7B7F; } /* Supporting Green */
.aqv-stock-status.out-of-stock { color: #E5AE41; } /* Meat Brown */

.aqv-product-description {
    font-size: 14px; color: #3c434a; margin-bottom: 18px; line-height: 1.65;
    font-family: 'DM Sans', sans-serif; /* DM Sans for body copy */
    max-height: 110px; overflow-y: auto; padding-right: 8px;
}

/* WooCommerce Form elements within Quick View */
.aqv-cart-form-wrapper { margin-bottom: 18px; }
.aqv-cart-form-wrapper form.cart .variations label { font-weight: 500; color: #053331; margin-bottom: 4px; display: block; font-size: 13px; }
.aqv-cart-form-wrapper form.cart .variations select { width: 100%; padding: 7px 10px; border: 1px solid #AABADA; border-radius: 3px; margin-bottom: 8px; font-size: 13px; }
.aqv-cart-form-wrapper form.cart .woocommerce-variation-price { margin-bottom: 12px; font-size: 1.1em; }
.aqv-cart-form-wrapper form.cart .single_variation_wrap { margin-bottom: 12px; }
.aqv-cart-form-wrapper form.cart .quantity { margin-right: 8px; margin-bottom: 8px; }
.aqv-cart-form-wrapper form.cart .quantity input.qty { width: 55px; text-align: center; padding: 7px; border: 1px solid #AABADA; border-radius: 3px;}

/* Buttons in Popup */
.aqv-popup-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.aqv-popup-buttons .button,
.aqv-cart-form-wrapper .single_add_to_cart_button {
    flex-grow: 1; flex-basis: calc(50% - 4px); /* Two buttons per row on small screens */
    padding: 9px 14px !important; font-size: 13px !important; font-weight: bold !important;
    color: #FFFFFF !important; background-color: #8C8CEA !important; /* Vista Blue */
    border: none !important; border-radius: 3px !important; text-decoration: none;
    text-align: center; cursor: pointer; transition: background-color 0.2s ease;
    font-family: 'DM Sans', sans-serif; /* DM Sans for buttons */
    line-height: 1.5 !important;
}
@media (max-width: 480px) { /* Single button per row on very small screens */
    .aqv-popup-buttons .button,
    .aqv-cart-form-wrapper .single_add_to_cart_button {
        flex-basis: 100%;
    }
}

.aqv-popup-buttons .button:hover,
.aqv-cart-form-wrapper .single_add_to_cart_button:hover { background-color: #5A7AED !important; } /* Blueberry */

.aqv-popup-buttons .whatsapp_button { background-color: #25D366 !important; }
.aqv-popup-buttons .whatsapp_button:hover { background-color: #1DA851 !important; }

.aqv-popup-buttons .buy_now_button {
    background-color: #A1EF8B !important; /* Light Green */
    color: #053331 !important; /* State Green text */
}
.aqv-popup-buttons .buy_now_button:hover { background-color: #82d36a !important; }

.aqv-view-full-details.button {
    display: block; width: 100%;
    background-color: #AABADA !important; /* Light Steel Blue */
    color: #053331 !important; /* State Green text */
    margin-top: 8px; box-sizing: border-box;
}
.aqv-view-full-details.button:hover { background-color: #8c9aaf !important; }

/* Popup Messages */
.aqv-popup-message {
    padding: 8px 12px; margin-top: 12px; border-radius: 3px; font-size: 13px; text-align: center;
    font-family: 'DM Sans', sans-serif;
}
.aqv-popup-message.success { background-color: #DOF7C5; color: #053331; border: 1px solid #A1EF8B; } /* Light Green shades */
.aqv-popup-message.error   { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }