/* ==========================================================================
   WESTORX Quick View Modal
   ========================================================================== */

/* ── Button on product card ──────────────────────────────────────────────── */
.woocommerce ul.products li.product {
    position: relative;
}

.wstx-quickview-btn {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    background: var(--color-white);
    color: var(--color-black);
    border: 1px solid var(--color-black);
    font-family: var(--font-primary);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, transform .3s ease, background .25s ease, color .25s ease;
    z-index: 5;
}

.woocommerce ul.products li.product:hover .wstx-quickview-btn {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.wstx-quickview-btn:hover {
    background: var(--color-black);
    color: var(--color-white);
}

.wstx-quickview-btn svg {
    flex-shrink: 0;
}

/* Mobile / touch devices: completely hide the button, no flash on tap */
@media (max-width: 767px),
       (hover: none),
       (pointer: coarse) {
    .wstx-quickview-btn {
        display: none !important;
    }
}

/* ── Overlay & Modal ─────────────────────────────────────────────────────── */
.wstx-qv-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.65);
    z-index: 9996;
    opacity: 0;
    visibility: hidden;
    transition: opacity .35s ease, visibility .35s ease;
}
.wstx-qv-overlay.open {
    opacity: 1;
    visibility: visible;
}

.wstx-qv-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -48%) scale(0.96);
    width: 92%;
    max-width: 960px;
    max-height: 90vh;
    background: var(--color-white);
    z-index: 9997;
    opacity: 0;
    visibility: hidden;
    transition: opacity .35s ease, transform .35s ease, visibility .35s ease;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
}
.wstx-qv-modal.open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.wstx-qv-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    background: var(--color-white);
    border: 1px solid var(--color-gray-2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-black);
    transition: background .25s ease, color .25s ease;
    z-index: 10;
    border-radius: 50%;
}
.wstx-qv-close:hover {
    background: var(--color-black);
    color: var(--color-white);
}

.wstx-qv-body {
    height: 100%;
    max-height: 90vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--color-gray-2) transparent;
}
.wstx-qv-body::-webkit-scrollbar { width: 6px; }
.wstx-qv-body::-webkit-scrollbar-thumb { background: var(--color-gray-2); border-radius: 3px; }

/* Loading state */
.wstx-qv-modal.is-loading .wstx-qv-body {
    min-height: 400px;
    position: relative;
}
.wstx-qv-modal.is-loading .wstx-qv-body::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
    border: 3px solid var(--color-gray-2);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: wstx-spin .8s linear infinite;
}

/* ── Grid layout ─────────────────────────────────────────────────────────── */
.wstx-qv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 500px;
}

/* Gallery */
.wstx-qv-gallery {
    background: var(--color-gray-1);
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.wstx-qv-main-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 320px;
}
.wstx-qv-main-image img {
    max-width: 100%;
    max-height: 420px;
    object-fit: contain;
    display: block;
}
.wstx-qv-thumbs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.wstx-qv-thumb {
    width: 56px;
    height: 56px;
    background: var(--color-white);
    border: 1px solid var(--color-gray-2);
    padding: 0;
    cursor: pointer;
    overflow: hidden;
    transition: border-color .25s ease;
}
.wstx-qv-thumb.active,
.wstx-qv-thumb:hover {
    border-color: var(--color-black);
}
.wstx-qv-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Summary */
.wstx-qv-summary {
    padding: 36px 36px 36px 32px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.wstx-qv-category {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-gray-3);
    margin: 0 0 10px 0;
}
.wstx-qv-title {
    font-family: var(--font-secondary);
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--color-black);
    margin: 0 0 12px 0;
    line-height: 1.2;
}
.wstx-qv-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-black);
    margin-bottom: 14px;
}
.wstx-qv-price del {
    color: var(--color-gray-3);
    font-weight: 400;
    margin-right: 8px;
    font-size: 0.95rem;
}
.wstx-qv-price ins {
    text-decoration: none;
    color: var(--color-accent);
}
.wstx-qv-urgency {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff3cd;
    color: #856404;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 6px 12px;
    margin-bottom: 14px;
    align-self: flex-start;
    letter-spacing: 0.02em;
}
.wstx-qv-desc {
    font-size: 0.88rem;
    line-height: 1.6;
    color: #444;
    margin-bottom: 20px;
}
.wstx-qv-desc p { margin: 0 0 8px; }

/* Form area — inherit existing single-product form styles */
.wstx-qv-form-wrap {
    margin-bottom: 18px;
}

.wstx-qv-fulldetails {
    margin-top: auto;
    color: var(--color-black);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-decoration: none;
    border-bottom: 1px solid var(--color-black);
    padding-bottom: 4px;
    align-self: flex-start;
    transition: color .25s ease, border-color .25s ease;
}
.wstx-qv-fulldetails:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .wstx-qv-modal {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        height: 100vh;
        top: 0;
        left: 0;
        transform: none;
        border-radius: 0;
    }
    .wstx-qv-modal.open {
        transform: none;
    }
    .wstx-qv-body {
        max-height: 100vh;
    }
    .wstx-qv-grid {
        grid-template-columns: 1fr;
        min-height: 0;
    }
    .wstx-qv-gallery {
        padding: 50px 20px 20px; /* room for close btn */
    }
    .wstx-qv-main-image {
        min-height: 240px;
    }
    .wstx-qv-main-image img {
        max-height: 280px;
    }
    .wstx-qv-summary {
        padding: 24px 20px 32px;
    }
    .wstx-qv-title {
        font-size: 1.3rem;
    }
    .wstx-qv-price {
        font-size: 1.1rem;
    }
}
