/* ============================================================
   Product Quickview Modal — structural layout only.
   Block styles (button, qty, variations, prices, descriptions)
   come from generated CSS returned in the quickview AJAX response.
   ============================================================ */

/* Overlay */
.cl-product-quickview-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.cl-product-quickview-overlay.cl-quickview-open {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Body scroll lock */
body.cl-quickview-modal-open {
    overflow: hidden;
}

/* Container */
.cl-product-quickview-overlay .cl-product-quickview {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    height: calc(90vh - 20px);
    overflow: clip;
    overflow-y: visible;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: cl-quickview-slide-in 0.25s ease-out;
}
@keyframes cl-quickview-slide-in {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header */
.cl-product-quickview-header {
    padding: 6px 10px 4px 10px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
}
.cl-product-quickview-title {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cl-product-quickview-header-prices .cl_p_prices {
    margin: 0;
    padding: 0;
}
button.cl-product-quickview-close {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    width: 30px;
    height: 30px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cl-product-quickview-close svg {
    width: 12px;
    height: 12px;
}

/* Body (scrollable) */
.cl-product-quickview-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
}

/* Loading state */
.cl-product-quickview-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    padding: 40px;
}
.cl-product-quickview-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--cl-border-color1, #e5e7eb);
    border-top-color: var(--cl-bg-color4, #3b82f6);
    border-radius: 50%;
    animation: cl-quickview-spin 0.6s linear infinite;
}
@keyframes cl-quickview-spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   Block overrides inside quickview context
   ============================================================ */

/* Gallery: reset product page layout rules (float/sticky/width%)
   Triple-class specificity (0,3,0) beats .single .cl_gallery (0,2,0) */
.cl-product-quickview-overlay .cl-product-quickview-body .cl_gallery {
    float: none !important;
    width: 100% !important;
    position: relative !important;
    top: auto !important;
    align-self: auto !important;
    height: auto !important;
}
.cl-product-quickview-overlay .cl-product-quickview-body .cl-gallery-slide img {
    width: 100% !important;
    height: auto !important;
    max-height: 400px;
    object-fit: contain;
}

/* Footer: structural layout only (qty + button styles come from generated CSS) */
.cl-product-quickview-footer {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-top: 1px solid var(--cl-border-color1, #e5e7eb);
    background: #fff;
    flex-shrink: 0;
    border-radius: 0 0 12px 12px;
}
.cl-product-quickview-footer button {
    max-height: 40px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 767px) {
    .cl-product-quickview-overlay .cl-product-quickview {
        width: 92%;
        max-width: none;
        height: calc(94vh - 20px);
        border-radius: 10px;
    }
    .cl-product-quickview-body {
        padding: 8px;
    }
}
