/* Zyra quick view — slide-in product preview (Phase 2.3).
 * A left drawer, deliberately wider (480px) than the hamburger menu drawer
 * (400px) and headed by the product image, so the two never read as the same
 * panel. Loaded from templates/footer.php so header.php stays untouched.
 * Theme-aware: uses the --fn-* variables, so it follows light/dark mode. */

.zyra-qv-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 1055;
    opacity: 0;
    transition: opacity .25s ease;
}

.zyra-qv-backdrop.is-open {
    opacity: 1;
}

.zyra-qv {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(480px, 94vw);
    background: var(--fn-body-bg);
    color: var(--fn-body-color);
    z-index: 1060;
    transform: translateX(-105%);
    transition: transform .3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 40px rgba(0, 0, 0, .25);
}

.zyra-qv.is-open {
    transform: translateX(0);
}

body.zyra-qv-open {
    overflow: hidden;
}

.zyra-qv-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--fn-border-color);
    flex: 0 0 auto;
}

.zyra-qv-title {
    font-weight: 700;
    font-size: .95rem;
    letter-spacing: .02em;
}

.zyra-qv-close {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    border-radius: 50%;
    border: 1px solid var(--fn-border-color);
    background: var(--fn-tertiary-bg);
    color: var(--fn-body-color);
    font-size: 1.35rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.zyra-qv-close:hover {
    background: var(--fn-secondary-bg);
}

.zyra-qv-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1rem;
    overscroll-behavior: contain;
}

/* --- Preview fragment (server-rendered by pages/product-preview.php) --- */

.zyra-qv-imgwell {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    overflow: hidden;
    background: var(--zyra-surface, var(--fn-tertiary-bg));
}

.zyra-qv-imgwell .zyra-badge {
    position: absolute;
    top: 10px;
    left: 10px;
}

.zyra-qv-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.zyra-qv-vendor {
    margin: .9rem 0 0;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--fn-secondary-color);
}

.zyra-qv-name {
    margin: .25rem 0 0;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.25;
}

.zyra-qv-subtitle {
    margin: .15rem 0 0;
    color: var(--fn-secondary-color);
}

.zyra-qv-price {
    margin: .7rem 0 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
}

.zyra-qv-rating {
    margin: .5rem 0 0;
}

.zyra-qv-desc {
    margin: .75rem 0 0;
    color: var(--fn-body-color);
}

.zyra-qv-stock {
    margin: .6rem 0 0;
    font-weight: 600;
}

/* Buy area (2026-12-03): qty + live total row, then Add to Bag (outline)
   and Add & Checkout (solid) — stacked on phones, side by side once the
   drawer is wide enough. Sticky so the actions stay in thumb reach. */
.zyra-qv-buy {
    position: sticky;
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    margin: 1rem -1rem 0;
    padding: .85rem 1rem;
    background: var(--fn-body-bg);
    border-top: 1px solid var(--fn-border-color);
    box-shadow: 0 -6px 16px rgba(0, 0, 0, .08);
}

.zyra-qv-buy-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.zyra-qv-buy .zyra-qty {
    flex: 0 0 auto;
}

.zyra-qv-actions {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.zyra-qv-actions .zyra-btn {
    width: 100%;
    min-height: 52px;
    justify-content: center;
}

@media (min-width: 560px) {
    .zyra-qv-actions { flex-direction: row; }
    .zyra-qv-actions .zyra-btn { flex: 1 1 0; width: auto; }
}

.zyra-qv-ship {
    margin: .85rem 0 0;
    font-size: .9rem;
    color: var(--fn-secondary-color);
}

.zyra-qv-preview .btn-outline-secondary.w-100 {
    margin-top: .85rem;
}
