/**
 * Quick View Styles - Optimized for AuraBricks Theme
 */

/* --- Parent Product Container --- */
.abr-product-card .abr-product-inner {
    position: relative;
}

/* --- Quick View Floating Button --- */
.aurabricks-quick-view-btn {
    position: relative; /* Inside the floating actions flex container */
    z-index: 25;
    
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    
    background: #fff;
    color: #111827;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    
    /* Animation state - Hidden by default in theme's flow */
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Show when parent is hovered */
.abr-product-card:hover .aurabricks-quick-view-btn {
    opacity: 1;
    transform: translateY(0);
}

.aurabricks-quick-view-btn:hover {
    background: #4f46e5; /* AuraBricks Indigo */
    color: #fff;
    transform: scale(1.05) !important;
}

/* Theme integration: abr-product-floating-actions is a flex column usually */
.abr-product-floating-actions {
    display: flex;
    flex-direction: column;
    gap: var(--abr-product-actions-gap, 8px);
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 30;
}

[dir="rtl"] .abr-product-floating-actions {
    right: auto;
    left: 15px;
}

/* Screen reader text helper */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* --- Modal & Overlay Styles --- */
.aurabricks-qv-overlay {
    visibility: hidden;
    opacity: 0;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7); 
    backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease;
}

.aurabricks-qv-overlay.is-open {
    visibility: visible;
    opacity: 1;
}

.aurabricks-qv-modal {
    background: #fff;
    border-radius: 20px;
    max-width: 1000px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 30px; /* Re-added padding for a cleaner feel */
    transform: scale(0.9) translateY(20px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
}

.is-open .aurabricks-qv-modal {
    transform: scale(1) translateY(0);
}

.aurabricks-qv-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #f8fafc;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: all 0.2s;
    z-index: 50;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

[dir="rtl"] .aurabricks-qv-close {
    right: auto;
    left: 20px;
}

.aurabricks-qv-close:hover {
    background: #ef4444;
    color: #fff;
    transform: rotate(90deg);
}

/* --- Fix: Force WooCommerce gallery to be visible inside Quick View --- */
.aurabricks-qv-images {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc; /* Soft background to fill space around contained image */
    border-radius: 12px;
    overflow: hidden;
}

.aurabricks-qv-images .woocommerce-product-gallery {
    opacity: 1 !important;
    width: 100%;
    display: block;
}

.aurabricks-qv-images .woocommerce-product-gallery .woocommerce-product-gallery__wrapper {
    display: block;
    width: 100%;
}

.aurabricks-qv-images .woocommerce-product-gallery .woocommerce-product-gallery__image {
    width: 100%;
}

.aurabricks-qv-images .woocommerce-product-gallery .woocommerce-product-gallery__image img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain; /* Shows FULL image without cropping */
    display: block;
}

.aurabricks-qv-images .woocommerce-product-gallery .flex-viewport,
.aurabricks-qv-images .woocommerce-product-gallery .flex-control-thumbs {
    display: none;
}

.aurabricks-qv-images .woocommerce-product-gallery .woocommerce-product-gallery__image:not(:first-child) {
    display: none; /* Show only main image in quick view */
}

/* --- Content Layout --- */
.aurabricks-qv-product {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: stretch;
}

.aurabricks-qv-summary {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

[dir="rtl"] .aurabricks-qv-summary {
    padding: 0;
}

.aurabricks-qv-view-more-wrapper {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #f1f5f9;
}

.aurabricks-qv-view-full {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* --- Loader & Spinner --- */
.aurabricks-qv-loader {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.is-loading .aurabricks-qv-loader {
    display: flex;
}

.aurabricks-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f1f5f9;
    border-top: 3px solid #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Mobile Fixes --- */
@media (max-width: 768px) {
    .aurabricks-qv-product {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .aurabricks-qv-modal {
        padding: 24px;
        width: 95%;
    }
    .aurabricks-quick-view-btn {
        opacity: 1; /* Always show on touch devices */
        transform: none;
    }
}
