/* ═══════════════════════════════════════════════════════════════════════════
   Vista rápida de producto — diseño v2

   Se carga SOLO en los negocios que encendieron el diseño nuevo. Todo cuelga
   de `.qv-scrim`, una clase que no existe en el tema clásico, así que ninguna
   regla se escapa a los tenants que siguen con el modal de siempre.

   El modal clásico (`.wrap-modal1`) y este NUNCA conviven: el partial imprime
   uno u otro según el interruptor del negocio.
   ═══════════════════════════════════════════════════════════════════════════ */

.qv-scrim {
    /* El acento sale de los ajustes del negocio; el índigo es el del tema. */
    --accent: #717fe0;
    --accent-tint: rgba(113, 127, 224, .12);
    --ink: #222;
    --ink-2: #555;
    --ink-3: #888;
    --ink-4: #aaa;
    --line: #e6e6e6;
    --soft: #f7f7f7;
    --page: #fff;
    --ease: cubic-bezier(.2, .7, .2, 1);

    position: fixed;
    inset: 0;
    /* El modal clásico vive en 9000; este se pone a la par para quedar sobre
       el encabezado fijo y el cajón del carrito. */
    z-index: 9000;
    background: rgba(20, 20, 26, .5);
    opacity: 0;
    visibility: hidden;
    transition: opacity .26s var(--ease), visibility .26s;
    display: grid;
    place-items: center;
    padding: clamp(12px, 3vw, 36px);
    font-family: 'Poppins', Arial, sans-serif;
    color: var(--ink-2);
}

.qv-scrim.open {
    opacity: 1;
    visibility: visible;
}

.qv-scrim *,
.qv-scrim *::before,
.qv-scrim *::after {
    box-sizing: border-box;
}

.qv-scrim a {
    color: inherit;
    text-decoration: none;
}

/* La lupa abre Magnific Popup, que por omisión se pinta en 1042 — o sea,
   debajo de este modal. Sin esto la foto ampliada quedaba invisible. */
body.shell-v2 .mfp-bg {
    z-index: 9500;
}

body.shell-v2 .mfp-wrap {
    z-index: 9501;
}

/* ── El modal ─────────────────────────────────────────────────────────── */
.qv {
    width: min(1020px, 100%);
    max-height: min(90vh, 760px);
    background: var(--page);
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .28);
    display: grid;
    grid-template-columns: 1.08fr 1fr;
    position: relative;
    transform: translateY(16px) scale(.985);
    opacity: 0;
    transition: transform .3s var(--ease), opacity .26s var(--ease);
}

.qv-scrim.open .qv {
    transform: none;
    opacity: 1;
}

.qv-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 4;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 999px;
    display: grid;
    place-items: center;
    cursor: pointer;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .94);
    color: var(--ink-2);
    transition: color .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}

.qv-close:hover {
    color: #fff;
    background: var(--ink);
    border-color: var(--ink);
}

.qv-close .material-icons {
    font-size: 20px;
}

/* ── Media ────────────────────────────────────────────────────────────── */
.qv-media {
    position: relative;
    background: var(--soft);
    border-right: 1px solid var(--line);
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 12px;
    padding: 16px;
    min-height: 0;
}

/* Con una sola foto el riel sobra y la imagen toma todo el ancho. */
.qv-media.single {
    grid-template-columns: 1fr;
}

.qv-rail {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    scrollbar-width: none;
    min-height: 0;
}

.qv-rail::-webkit-scrollbar {
    display: none;
}

.qv-rail[hidden] {
    display: none;
}

.qv-thumb {
    flex: 0 0 auto;
    position: relative;
    width: 64px;
    aspect-ratio: 1/1;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background: var(--page);
    cursor: pointer;
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}

.qv-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.qv-thumb:hover {
    border-color: var(--ink-4);
}

.qv-thumb.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-tint);
}

.qv-stage {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: var(--page);
    border: 1px solid var(--line);
    min-height: 0;
}

/* `contain` por lo mismo que en las tarjetas: con `cover` el marco se comía
   el borde de las fotos verticales y una prenda a medias no vende. */
.qv-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    cursor: zoom-in;
}

.qv-zoom {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 3;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 999px;
    display: grid;
    place-items: center;
    cursor: pointer;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .94);
    color: var(--ink-2);
    transition: color .18s var(--ease), border-color .18s var(--ease);
}

.qv-zoom:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.qv-zoom .material-icons {
    font-size: 19px;
}

.qv-flag {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    line-height: 1;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
}

.qv-flag.sale {
    background: var(--accent);
}

.qv-flag.out {
    background: var(--ink-3);
}

/* ── Columna de compra ────────────────────────────────────────────────── */
.qv-info {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    padding: clamp(24px, 3vw, 34px) clamp(22px, 3vw, 34px) 0;
}

.qv-eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.qv-eyebrow .material-icons {
    font-size: 13px;
    color: var(--ink-4);
}

.qv-eyebrow[hidden] {
    display: none;
}

.qv-title {
    margin: 0;
    padding-right: 44px;
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 500;
    font-size: clamp(22px, 2.4vw, 30px);
    line-height: 1.12;
    letter-spacing: -.01em;
    color: var(--ink);
}

.qv-price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
    margin: 14px 0 0;
}

.qv-now {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--ink);
}

.qv-was {
    font-size: 14px;
    color: var(--ink-4);
    text-decoration: line-through;
}

.qv-off {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--accent-tint);
    color: var(--accent);
}

.qv-stock {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--ink-3);
    display: flex;
    align-items: center;
    gap: 6px;
}

.qv-stock .dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #3f9d63;
    flex: 0 0 auto;
}

.qv-stock.low .dot {
    background: #d98324;
}

.qv-stock.out .dot {
    background: var(--ink-4);
}

.qv-hr {
    height: 1px;
    background: var(--line);
    margin: 22px 0;
}

/* La descripción es contenido de CKEditor: se le da tamaño y color, nunca
   tipografía ni pesos, para no pisar lo que el negocio dejó escrito. */
.qv-desc {
    font-size: 13px;
    line-height: 1.65;
    color: var(--ink-2);
    margin: 0 0 20px;
    max-height: 132px;
    overflow-y: auto;
}

.qv-desc[hidden] {
    display: none;
}

.qv-desc p:last-child {
    margin-bottom: 0;
}

.qv-desc img {
    max-width: 100%;
    height: auto;
}

/* ── Selector de variantes: chips que escriben en el select real ──────── */
.qv-field {
    margin: 0 0 20px;
}

.qv-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.qv-chosen {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--accent);
}

.qv-sizes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.qv-size {
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    min-width: 52px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--page);
    color: var(--ink-2);
    transition: border-color .16s var(--ease), color .16s var(--ease), background .16s var(--ease);
}

.qv-size:hover:not(:disabled) {
    border-color: var(--ink-4);
    color: var(--ink);
}

.qv-size.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.qv-size:disabled {
    cursor: not-allowed;
    color: var(--ink-4);
    background: var(--soft);
    text-decoration: line-through;
}

/* El select verdadero sigue existiendo: es el que lleva el `name` y el que
   leería un navegador sin JavaScript. Solo se saca de la vista. */
.qv-native {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* ── Acciones ─────────────────────────────────────────────────────────── */
.qv-actions {
    position: sticky;
    bottom: 0;
    background: var(--page);
    padding: 0 0 clamp(22px, 3vw, 30px);
    margin-top: auto;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: center;
}

.qv-actions::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 18px;
    margin-top: -18px;
    background: linear-gradient(to top, var(--page), transparent);
    pointer-events: none;
}

.qv-qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}

.qv-qty button {
    cursor: pointer;
    font-family: inherit;
    width: 40px;
    height: 46px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 0;
    background: var(--page);
    color: var(--ink-2);
    transition: background .16s var(--ease), color .16s var(--ease);
}

.qv-qty button:hover {
    background: var(--soft);
    color: var(--accent);
}

.qv-qty button .material-icons {
    font-size: 18px;
}

.qv-qty input {
    width: 44px;
    height: 46px;
    border: 0;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    text-align: center;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    background: var(--page);
    -moz-appearance: textfield;
}

.qv-qty input::-webkit-outer-spin-button,
.qv-qty input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qv-add {
    cursor: pointer;
    font-family: inherit;
    height: 46px;
    padding: 0 22px;
    border: 1px solid var(--accent);
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    transition: transform .16s var(--ease), box-shadow .2s var(--ease), background .16s var(--ease);
}

.qv-add .material-icons {
    font-size: 18px;
}

.qv-add:hover:not(:disabled) {
    filter: brightness(.94);
    transform: translateY(-1px);
    box-shadow: 0 8px 22px var(--accent-tint);
}

.qv-add:disabled {
    cursor: not-allowed;
    background: var(--soft);
    border-color: var(--line);
    color: var(--ink-4);
    transform: none;
    box-shadow: none;
}

.qv-detail {
    grid-column: 1/-1;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-3);
    padding-top: 4px;
}

.qv-detail:hover {
    color: var(--accent);
}

.qv-detail .material-icons {
    font-size: 17px;
}

.qv-detail[hidden] {
    display: none;
}

/* ── Móvil ────────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
    .qv {
        grid-template-columns: 1fr;
        max-height: 92vh;
        overflow-y: auto;
    }

    .qv-media {
        border-right: 0;
        border-bottom: 1px solid var(--line);
        grid-template-columns: 1fr;
    }

    .qv-stage {
        aspect-ratio: 1/1;
    }

    .qv-rail {
        flex-direction: row;
        order: 2;
        overflow-x: auto;
    }

    .qv-thumb {
        width: 56px;
    }

    .qv-info {
        overflow: visible;
    }

    .qv-desc {
        max-height: none;
        overflow: visible;
    }
}
