/* ═══════════════════════════════════════════════════════════════════════════
   Ficha de producto — diseño v2

   Se carga SOLO en los negocios que encendieron el diseño nuevo. Todo cuelga
   de `.pdv`, una clase que no existe en el tema clásico.

   La ficha vieja y esta nunca conviven: la vista imprime una u otra según el
   interruptor del negocio.
   ═══════════════════════════════════════════════════════════════════════════ */

.pdv {
    /* 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;
    --r-card: 14px;
    --maxw: 1380px;
    --ease: cubic-bezier(.2, .7, .2, 1);

    padding: 0 0 clamp(40px, 6vh, 70px);
    font-family: 'Poppins', Arial, sans-serif;
    color: var(--ink-2);
    background: var(--page);
}

.pdv *,
.pdv *::before,
.pdv *::after {
    box-sizing: border-box;
}

.pdv a {
    color: inherit;
    text-decoration: none;
}

.pdv a:hover {
    color: var(--accent);
}

.pdv-wrap {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 clamp(18px, 4vw, 60px);
}

/* ── Miga de pan ──────────────────────────────────────────────────────── */
.pdv-crumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 18px 0 0;
    font-size: 12px;
    color: var(--ink-3);
}

.pdv-crumbs .material-icons {
    font-size: 15px;
    color: var(--ink-4);
}

.pdv-crumbs .now {
    color: var(--ink-4);
}

/* ── Grilla ───────────────────────────────────────────────────────────── */
.pdv-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr);
    gap: clamp(24px, 3.4vw, 56px);
    align-items: start;
    padding-top: clamp(18px, 2.4vw, 30px);
}

/* ── Galería ──────────────────────────────────────────────────────────── */
.pdv-gal {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 12px;
    position: sticky;
    top: 80px;
}

.pdv-gal.single {
    grid-template-columns: minmax(0, 1fr);
}

.pdv-rail {
    display: flex;
    flex-direction: column;
    gap: 9px;
    max-height: 560px;
    overflow-y: auto;
    scrollbar-width: none;
}

.pdv-rail::-webkit-scrollbar {
    display: none;
}

.pdv-gal.single .pdv-rail {
    display: none;
}

.pdv-thumb {
    position: relative;
    flex: 0 0 auto;
    width: 76px;
    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);
}

.pdv-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pdv-thumb:hover {
    border-color: var(--ink-4);
}

.pdv-thumb.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-tint);
}

.pdv-stage {
    position: relative;
    aspect-ratio: 4/5;
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    overflow: hidden;
    background: var(--page);
}

/* `contain` por lo mismo que en las tarjetas y en la vista rápida: con
   `cover` el marco recorta las fotos verticales, y una prenda a medias no
   vende. */
.pdv-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    cursor: zoom-in;
}

.pdv-zoom {
    position: absolute;
    bottom: 14px;
    right: 14px;
    z-index: 3;
    width: 40px;
    height: 40px;
    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);
}

.pdv-zoom:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.pdv-zoom .material-icons {
    font-size: 20px;
}

.pdv-flag {
    position: absolute;
    top: 14px;
    left: 14px;
    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(--accent);
    color: #fff;
}

/* ── Columna de compra ────────────────────────────────────────────────── */
.pdv-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);
}

.pdv-eyebrow .material-icons {
    font-size: 13px;
    color: var(--ink-4);
}

.pdv-title {
    margin: 0;
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 500;
    font-size: clamp(26px, 3.1vw, 38px);
    line-height: 1.1;
    letter-spacing: -.01em;
    color: var(--ink);
}

.pdv-order {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 12px 0 0;
    font-size: 12px;
    font-weight: 500;
    color: #d98324;
}

.pdv-order .material-icons {
    font-size: 16px;
}

.pdv-price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0 0;
}

.pdv-now {
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--ink);
}

.pdv-was {
    font-size: 15px;
    color: var(--ink-4);
    text-decoration: line-through;
}

.pdv-off {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--accent-tint);
    color: var(--accent);
}

.pdv-unit {
    font-size: 12px;
    color: var(--ink-4);
}

.pdv-stock {
    margin: 10px 0 0;
    font-size: 12.5px;
    color: var(--ink-3);
    display: flex;
    align-items: center;
    gap: 7px;
}

.pdv-stock .dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #3f9d63;
    flex: 0 0 auto;
}

.pdv-stock.low .dot {
    background: #d98324;
}

.pdv-hr {
    height: 1px;
    background: var(--line);
    margin: 24px 0;
}

/* ── Variantes: chips que escriben en el <select> real ────────────────── */
.pdv-field {
    margin: 0 0 22px;
}

.pdv-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);
}

.pdv-chosen {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--accent);
}

.pdv-sizes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pdv-size {
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    min-width: 54px;
    padding: 11px 15px;
    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);
}

.pdv-size:hover:not(:disabled) {
    border-color: var(--ink-4);
    color: var(--ink);
}

.pdv-size.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.pdv-size:disabled {
    cursor: not-allowed;
    color: var(--ink-4);
    background: var(--soft);
    text-decoration: line-through;
}

/* El <select> de siempre sigue en la página con su `name` y su valor: es el
   que lee el botón de agregar y el que dispara el cálculo de precio. Solo se
   saca de la vista, junto con lo que le cuelgue select2. */
.pdv-native {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

/* ── Acciones ─────────────────────────────────────────────────────────── */
.pdv-actions {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
}

.pdv-qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}

.pdv-qty button {
    cursor: pointer;
    font-family: inherit;
    width: 42px;
    height: 50px;
    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);
}

.pdv-qty button:hover {
    background: var(--soft);
    color: var(--accent);
}

.pdv-qty button .material-icons {
    font-size: 18px;
}

.pdv-qty input {
    width: 46px;
    height: 50px;
    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;
}

.pdv-qty input::-webkit-outer-spin-button,
.pdv-qty input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pdv-add {
    cursor: pointer;
    font-family: inherit;
    height: 50px;
    padding: 0 24px;
    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), filter .16s var(--ease);
}

.pdv-add .material-icons {
    font-size: 18px;
}

.pdv-add:hover:not(:disabled) {
    filter: brightness(.94);
    transform: translateY(-1px);
    box-shadow: 0 8px 22px var(--accent-tint);
}

.pdv-add:disabled {
    cursor: not-allowed;
    background: var(--soft);
    border-color: var(--line);
    color: var(--ink-4);
    transform: none;
    box-shadow: none;
}

/* El corazón conserva la clase y el icono que espera el manejador de
   favoritos; lo que cambia es el marco que lo rodea. */
.pdv-fav {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    background: var(--page);
    color: var(--ink-3);
    font-size: 18px;
    transition: color .16s var(--ease), border-color .16s var(--ease);
}

.pdv-fav:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* El manejador existente le pone `text-danger` al <i>; eso es lo que marca
   el estado, así que se pinta desde ahí. */
.pdv-fav .fa-heart.text-danger {
    color: var(--accent) !important;
}

.pdv-fav:has(.text-danger) {
    border-color: var(--accent);
    background: var(--accent-tint);
}

/* ── Acordeón ─────────────────────────────────────────────────────────── */
.pdv-acc {
    margin: 26px 0 0;
    border-top: 1px solid var(--line);
}

.pdv-acc-item {
    border-bottom: 1px solid var(--line);
}

.pdv-acc-head {
    width: 100%;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 2px;
    border: 0;
    background: 0;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ink);
    transition: color .16s var(--ease);
}

.pdv-acc-head:hover {
    color: var(--accent);
}

.pdv-acc-head .material-icons {
    font-size: 20px;
    color: var(--ink-4);
    transition: transform .22s var(--ease);
}

.pdv-acc-item.open .pdv-acc-head .material-icons {
    transform: rotate(180deg);
    color: var(--accent);
}

/* El cuerpo de «Descripción» es contenido de CKEditor: se le da tamaño y
   color, nunca tipografía ni pesos. */
.pdv-acc-body {
    display: none;
    padding: 0 2px 18px;
    font-size: 13px;
    line-height: 1.65;
    color: var(--ink-2);
    max-width: 60ch;
}

.pdv-acc-item.open .pdv-acc-body {
    display: block;
}

.pdv-acc-body img {
    max-width: 100%;
    height: auto;
}

.pdv-acc-body p:last-child {
    margin-bottom: 0;
}

.pdv-specs {
    display: grid;
    gap: 9px;
    margin: 0;
}

.pdv-spec {
    display: flex;
    gap: 10px;
    font-size: 13px;
}

.pdv-spec dt {
    flex: 0 0 34%;
    color: var(--ink-3);
}

.pdv-spec dd {
    margin: 0;
    color: var(--ink);
}

/* ── Móvil ────────────────────────────────────────────────────────────── */
@media (max-width: 940px) {
    .pdv-grid {
        grid-template-columns: 1fr;
        gap: 26px;
    }

    .pdv-gal {
        position: static;
        grid-template-columns: minmax(0, 1fr);
    }

    .pdv-rail {
        flex-direction: row;
        order: 2;
        max-height: none;
        overflow-x: auto;
    }

    .pdv-thumb {
        width: 64px;
    }

    .pdv-stage {
        aspect-ratio: 1/1;
    }

    .pdv-actions {
        grid-template-columns: auto 1fr;
    }

    .pdv-fav {
        grid-column: 2;
        width: 100%;
    }
}
