/* Ficha del producto (views/productPage.hbs) y vista rapida (openmodal de public/js/shoppingCart.js), 30-10-2026.
   Un solo lenguaje visual para las dos, con los colores del sitio: tinta #26323e, naranja #ff5319 y verde #4fbe31.
   La ficha lo carga con un <link>; la vista rapida lo pide sola (cargarEstilos), asi no hay que tocar cada listado. */

.pf-pagina,
.vr-modal {
    /* Los colores salen de sitio.css; el valor de respaldo es para una pagina que no lo cargue. */
    --pv-tinta: var(--ss-tinta, #26323e);
    --pv-texto: var(--ss-texto, #2e3a47);
    --pv-suave: var(--ss-suave, #5f6d7a);
    --pv-linea: var(--ss-linea, #e1e6ea);
    --pv-fondo: var(--ss-fondo, #f5f7f9);
    --pv-naranja: var(--ss-naranja, #ff5319);
    --pv-verde: var(--ss-verde, #4fbe31);
    --pv-verde-fuerte: var(--ss-verde-fuerte, #43a829);
    color: var(--pv-texto);
}

/* ------------------------------------------------------------------ galeria (galeriaProducto.js) */
.pv-galeria {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.pv-visor {
    display: flex;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    border-radius: 12px;
    background: #fff;
}

.pv-visor::-webkit-scrollbar {
    display: none;
}

.pv-foto {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 12px;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pv-foto .img_producto {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pv-miniaturas {
    display: flex;
    gap: 8px;
    justify-content: center;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 2px;
}

.pv-miniaturas::-webkit-scrollbar {
    display: none;
}

.pv-mini {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    padding: 4px;
    background: #fff;
    border: 1px solid var(--pv-linea);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}

.pv-mini img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.pv-mini:hover {
    border-color: #acbdcd;
}

.pv-mini.activeCarousel {
    border-color: var(--pv-naranja);
    box-shadow: 0 0 0 1px var(--pv-naranja);
}

.pv-mini:focus-visible {
    outline: 2px solid var(--pv-tinta);
    outline-offset: 1px;
}

/* ------------------------------------------------------------------ cantidad + - */
.pv-cantidad {
    display: inline-flex;
    align-items: stretch;
    flex: 0 0 auto;
    height: 48px;
    border: 1px solid #c9d2da;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

/* styles.css le da posicion y tamanos con !important a #amount y a .quantity-button en el celular */
.pf-pagina .pv-cantidad .quantity-button {
    position: static;
    width: 44px !important;
    height: auto !important;
    border: 0;
}

.pv-cantidad button {
    width: 44px;
    border: 0;
    background: #fff;
    color: var(--pv-tinta);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
    transition: background .15s;
}

.pv-cantidad button:hover:not(:disabled) {
    background: var(--pv-fondo);
}

.pv-cantidad button:disabled {
    color: #acbdcd;
    cursor: default;
}

.pv-cantidad input,
.pf-pagina .pv-cantidad #amount {
    width: 52px !important;
    height: auto !important;
    padding: 0;
    border: 0;
    border-left: 1px solid var(--pv-linea);
    border-right: 1px solid var(--pv-linea);
    border-radius: 0;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    color: var(--pv-tinta);
    background: #fff;
    outline: none;
    box-shadow: none;
}

.pv-cantidad input:focus {
    background: var(--pv-fondo);
}

/* ------------------------------------------------------------------ boton de compra */
.pv-comprar {
    flex: 1 1 auto;
    min-width: 0;
    height: 48px;
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    background: var(--pv-verde);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .01em;
    cursor: pointer;
    transition: background .15s;
}

.pv-comprar:hover:not(:disabled) {
    background: var(--pv-verde-fuerte);
}

.pv-comprar:disabled {
    opacity: .75;
    cursor: default;
}

.pv-comprar .spinner-border-sm {
    color: #fff !important;
    width: 1rem;
    height: 1rem;
    border-width: .2em;
}

.pv-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--pv-tinta);
    font-size: .9rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: #acbdcd;
    cursor: pointer;
}

.pv-link:hover {
    color: var(--pv-naranja);
    text-decoration-color: currentColor;
}

/* ------------------------------------------------------------------ descripcion, en las dos pantallas */
.pv-desc {
    font-size: .95rem;
    line-height: 1.55;
    color: var(--pv-texto);
    overflow-wrap: break-word;
}

.pv-desc h1,
.pv-desc h2,
.pv-desc h3,
.pv-desc h4,
.pv-desc h5,
.pv-desc h6 {
    margin: 1.1rem 0 .3rem;
    font-family: inherit;
    font-weight: 700;
    color: var(--pv-tinta);
    line-height: 1.3;
}

.pv-desc h1,
.pv-desc h2,
.pv-desc h3 {
    font-size: 1.1rem;
}

.pv-desc h4,
.pv-desc h5 {
    font-size: 1rem;
}

.pv-desc h6 {
    font-size: .95rem;
}

.pv-desc p {
    margin: 0 0 .7rem;
    padding: 0;
}

.pv-desc ul,
.pv-desc ol {
    margin: 0 0 .9rem;
    padding-left: 1.25rem;
}

.pv-desc li {
    margin-bottom: .2rem;
}

.pv-desc img {
    max-width: 100%;
    height: auto;
}

.pv-desc iframe {
    max-width: 100%;
}

.pv-desc .description-text > :first-child {
    margin-top: 0;
}

/* Las tablas llegan con width, height y border escritos en el HTML del proveedor */
.pv-desc table {
    width: 100% !important;
    height: auto !important;
    margin: .75rem 0 1.1rem;
    border: 1px solid var(--pv-linea) !important;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.pv-desc table th,
.pv-desc table td {
    height: auto !important;
    padding: 8px 12px;
    border: 0 !important;
    border-bottom: 1px solid var(--pv-linea) !important;
    vertical-align: top;
    background: transparent;
    color: var(--pv-texto);
}

.pv-desc table tr:last-child > th,
.pv-desc table tr:last-child > td {
    border-bottom: 0 !important;
}

.pv-desc table tr:nth-child(odd) > th,
.pv-desc table tr:nth-child(odd) > td {
    background: var(--pv-fondo);
}

.pv-desc table td:first-child {
    width: 38%;
    color: var(--pv-tinta);
}

.pv-desc table td:only-child {
    width: auto;
}

.pv-desc .table-responsive {
    overflow-x: auto;
}

/* Descripciones en formato de secciones (hoy casi no quedan) */
.pv-desc .section {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin: 1rem 0;
}

.pv-desc .section-name {
    flex: 0 0 200px;
    font-size: .95rem;
    color: var(--pv-tinta);
}

.pv-desc .properties {
    flex: 1 1 auto;
    min-width: 0;
}

.pv-desc .property {
    display: flex;
    gap: 1rem;
    padding: .4rem .6rem;
}

.pv-desc .property > span:first-child {
    flex: 0 0 40%;
    font-weight: 600;
}

.pv-desc .property-values {
    display: flex;
    flex-direction: column;
}

.pv-desc .header-description {
    text-align: center;
}

.characteristicContainer {
    display: flex;
    align-items: center;
    border-top: 1px solid var(--pv-linea);
    padding-top: 1rem;
}

.title-characteristic {
    width: 14rem;
}

/* ================================================================== FICHA */
.pf-pagina .header-index {
    width: 100%;
    margin-top: 12px;
}

.pf-pagina .indices_ {
    width: 100%;
    padding: 20px 0 10px !important;
}

.pf-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 40px;
    align-items: start;
    margin: 8px 0 32px;
}

.pf-pagina .imagenesProducto {
    position: relative;
    min-width: 0;
}

.pf-galeria {
    max-width: 560px;
    margin: 0 auto;
}

.pf-pagina .contenedor-principal {
    min-width: 0;
    padding: 24px;
    background: #fff;
    border: 1px solid var(--pv-linea);
    border-radius: 12px;
}

.pf-marca {
    display: block;
    height: 36px;
    width: auto;
    max-width: 170px;
    object-fit: contain;
    object-position: left center;
    margin-bottom: 12px;
}

.pf-pagina .denominacion-producto {
    margin: 0 !important;
    font-family: inherit;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--pv-tinta);
}

.pf-codigo {
    margin: 6px 0 0;
    padding: 0;
    font-size: .85rem;
    color: var(--pv-suave);
}

.pf-precios {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 18px 0 4px;
}

.pf-pagina .precioUnit {
    margin: 0 !important;
    padding: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--pv-suave);
}

/* La moneda que eligio el cliente manda; la otra queda de referencia */
.pf-precios.es-ar .precioUnit.AR,
.pf-precios.es-usd .precioUnit.USD {
    order: -1;
    font-size: 2rem;
    font-weight: 700;
    color: var(--pv-tinta);
}

.combo-suelto {
    margin: 6px 0 0;
    padding: 0;
    font-size: .9rem;
    color: var(--pv-suave);
}

.combo-suelto b {
    margin-left: .35rem;
    color: #157347;
}

.pf-compra {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.pf-nota-cantidad {
    margin: 8px 0 0;
    padding: 0;
    font-size: .8rem;
    color: var(--pv-suave);
}

.pf-cuotas {
    margin-top: 16px;
    padding: 12px 14px;
    background: var(--pv-fondo);
    border-radius: 8px;
}

.pf-cuotas p {
    margin: 0;
    padding: 0;
    font-size: .95rem;
    color: var(--pv-texto);
}

.pf-pagina .resalted {
    font-weight: 700;
    color: var(--pv-naranja);
}

.pf-medios {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-top: 8px;
}

.pf-medios img {
    width: 37px;
    height: 24px;
    object-fit: contain;
}

.pf-medios .pv-link {
    margin-left: auto;
    font-size: .85rem;
}

.pf-datos {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0 0;
    padding: 16px 0 0;
    list-style: none;
    border-top: 1px solid var(--pv-linea);
    font-size: .95rem;
}

.pf-datos li {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.pf-datos i {
    flex: 0 0 auto;
    color: var(--pv-suave);
}

.pf-datos i.pf-naranja {
    color: var(--pv-naranja);
}

.pf-datos #stockText:empty {
    display: none;
}

.pf-pagina .dolar-text {
    margin: 12px 0 0;
    padding: 0;
    font-size: .75rem;
    line-height: 1.35;
    color: var(--pv-suave);
}

/* Sin stock / no disponible */
.pf-estado {
    margin-top: 18px;
    padding: 16px;
    background: var(--pv-fondo);
    border-radius: 8px;
    text-align: center;
}

.pf-estado-titulo {
    margin: 0 0 6px;
    padding: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--pv-tinta);
}

.pf-estado p {
    margin: 0 0 12px;
    padding: 0;
    font-size: .95rem;
    color: var(--pv-suave);
}

.pf-estado p:last-child {
    margin-bottom: 0;
}

.pf-estado .pf-ok {
    font-weight: 700;
    color: #157347;
}

.pf-boton-sec {
    width: 100%;
    min-height: 46px;
    padding: 8px 16px;
    border: 0;
    border-radius: 8px;
    background: var(--pv-naranja);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.pf-boton-sec.es-suave {
    width: auto;
    min-height: 0;
    padding: 6px 16px;
    background: #fff;
    border: 1px solid #c9d2da;
    color: var(--pv-tinta);
    font-weight: 600;
}

.pf-boton-sec .spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: .2em;
    color: #fff !important;
}

/* Descripcion */
.pf-descripcion {
    margin-bottom: 32px;
    padding: 24px;
    background: #fff;
    border: 1px solid var(--pv-linea);
    border-radius: 12px;
}

.pf-descripcion-titulo {
    margin: 0 0 14px !important;
    padding: 0 0 10px;
    font-family: inherit;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--pv-tinta);
    border-bottom: 1px solid var(--pv-linea);
}

.pf-pagina .temporaryHidden {
    display: none;
}

.modal-backdrop {
    --bs-backdrop-zindex: 1052 !important;
}

.tooltip-error-class {
    --bs-tooltip-bg: var(--bs-red);
}

.th {
    text-align: left;
}

.td {
    padding: 3px;
}

@media (max-width: 1000px) {
    .pf-pagina .header-index {
        display: none;
    }

    .pf-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
        margin-top: 12px;
    }

    .pf-galeria {
        max-width: 480px;
    }

    .pf-pagina .contenedor-principal,
    .pf-descripcion {
        padding: 16px;
    }

    /* La compra queda siempre a mano, en una barra abajo */
    .pf-compra {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1029;
        margin: 0;
        padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
        background: #fff;
        box-shadow: 0 -2px 10px rgba(38, 50, 62, .14);
    }

    .pf-con-barra {
        padding-bottom: 72px;
    }

    .pf-con-barra .floatwp {
        bottom: 84px !important;
    }

    .pf-con-barra .t-chat-boton {
        bottom: 82px;
    }

    .pf-con-barra .t-chat-globo {
        bottom: 138px;
    }

    .pf-nota-cantidad {
        display: none;
    }

    .pf-pagina .denominacion-producto {
        font-size: 1.3rem;
    }

    .pf-precios.es-ar .precioUnit.AR,
    .pf-precios.es-usd .precioUnit.USD {
        font-size: 1.75rem;
    }

    .pv-desc .section {
        flex-direction: column;
        gap: .4rem;
    }

    .pv-desc .section-name {
        flex: none;
    }

    .pv-desc .property {
        flex-direction: column;
        gap: 0;
    }
}

@media (max-width: 400px) {
    .pv-comprar {
        font-size: .9rem;
        padding: 0 8px;
    }

    .pv-cantidad button {
        width: 40px;
    }

    .pf-pagina .pv-cantidad .quantity-button {
        width: 40px !important;
    }

    .pv-cantidad input,
    .pf-pagina .pv-cantidad #amount {
        width: 44px !important;
    }
}

/* ================================================================== VISTA RAPIDA */
/* styles.css y productos.hbs traen .modal-content gris y .modal-dialog de 600 px, los dos con !important */
.vr-modal .vr-dialogo {
    width: calc(100vw - 24px);
    max-width: 880px !important;
    margin: 12px auto;
    min-height: calc(100% - 24px);
}

.vr-modal .vr-contenido {
    position: relative;
    overflow: hidden;
    border: 0;
    border-radius: 14px !important;
    background-color: #fff !important;
    box-shadow: 0 18px 50px rgba(20, 30, 40, .28);
}

.vr-cerrar {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .9);
    color: var(--pv-tinta);
    font-size: 1rem;
    cursor: pointer;
    transition: background .15s;
}

.vr-cerrar:hover {
    background: var(--pv-fondo);
}

.vr-vista {
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
}

.vr-principal {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.vr-galeria {
    position: relative;
    min-width: 0;
    padding: 20px;
    border-right: 1px solid var(--pv-linea);
}

.vr-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 28px 28px 24px;
}

.vr-marca {
    margin: 0 44px 4px 0;
    padding: 0;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--pv-suave);
}

.vr-modal .vr-titulo {
    margin: 0 28px 0 0 !important;
    padding: 0;
    font-family: inherit;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
    color: var(--pv-tinta);
}

.vr-codigo {
    margin: 6px 0 0;
    padding: 0;
    font-size: .85rem;
    color: var(--pv-suave);
}

.vr-precio {
    margin: 16px 0 0;
    padding: 0;
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--pv-tinta);
}

.vr-stock {
    margin: 8px 0 0;
    padding: 0;
    font-size: .85rem;
    font-weight: 700;
}

.vr-stock i {
    margin-left: 2px;
}

.vr-compra {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.vr-compra .pv-comprar {
    flex: 1 1 190px;
    white-space: nowrap;
}

.vr-total {
    margin: 8px 0 0;
    padding: 0;
    font-size: .9rem;
    color: var(--pv-suave);
}

.vr-total b {
    color: var(--pv-tinta);
}

.vr-aviso-texto {
    margin: 18px 0 0;
    padding: 8px 12px;
    font-size: .9rem;
    color: #8a5300;
    background: #fff4e5;
    border: 1px solid #ffe0b2;
    border-radius: 8px;
}

.vr-elegir {
    flex: none;
    width: 100%;
    margin-top: 18px;
}

.vr-enlaces {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-top: auto;
    padding-top: 18px;
}

/* Especificaciones: dentro de la misma ventana */
.vr-specs-cabecera {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 10px 56px 10px 16px;
    background: #fff;
    border-bottom: 1px solid var(--pv-linea);
}

.vr-volver {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #c9d2da;
    border-radius: 8px;
    background: #fff;
    color: var(--pv-tinta);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
}

.vr-volver:hover {
    background: var(--pv-fondo);
}

.vr-specs-titulo {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: .95rem;
    font-weight: 700;
    color: var(--pv-tinta);
}

.vr-specs-cuerpo {
    padding: 20px 24px 28px;
}

/* Lo que no entra en la pantalla se avisa (regla de los pop-ups largos) */
.vr-mas-abajo {
    position: absolute;
    left: 50%;
    bottom: 12px;
    z-index: 4;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 0;
    border-radius: 999px;
    background: var(--pv-tinta);
    color: #fff;
    font-size: .8rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(20, 30, 40, .3);
    cursor: pointer;
}

.vr-mas-abajo[hidden] {
    display: none;
}

@media (max-width: 720px) {
    .vr-principal {
        grid-template-columns: minmax(0, 1fr);
    }

    .vr-galeria {
        padding: 12px 12px 4px;
        border-right: 0;
    }

    .vr-galeria .pv-galeria {
        max-width: 280px;
        margin: 0 auto;
    }

    .vr-info {
        padding: 12px 16px 20px;
    }

    .vr-modal .vr-titulo {
        font-size: 1.15rem;
        margin-right: 0 !important;
    }

    .vr-marca {
        margin-right: 0;
    }

    .vr-precio {
        font-size: 1.6rem;
    }

    .vr-specs-cuerpo {
        padding: 16px;
    }
}

/* Aviso de "ya no esta disponible" */
.vr-modal.vr-sin-stock .modal-dialog {
    max-width: 460px !important;
}

.vr-sin-stock .vr-contenido {
    padding: 28px 24px 20px;
    text-align: center;
}

.vr-sin-stock-titulo {
    margin: 0 0 8px !important;
    font-family: inherit;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--pv-tinta);
}

.vr-sin-stock-texto {
    margin: 0;
    padding: 0;
    font-size: 1rem;
    color: var(--pv-texto);
}

.vr-sin-stock-bloque {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--pv-linea);
}

.vr-sin-stock-bloque p {
    margin: 0 0 12px;
    padding: 0;
    font-size: .95rem;
    color: var(--pv-suave);
}

.vr-sin-stock-bloque p.es-fuerte {
    margin-bottom: 4px;
    font-weight: 700;
    color: var(--pv-tinta);
}

.vr-sin-stock .ty-btn {
    width: 100%;
    margin: 0;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 700;
}

.vr-sin-stock-cerrar {
    margin-top: 12px;
}
