/* ============================================================
   TopoApp — Vista de producto del catálogo público
   Neutra y limpia; el color del negocio solo en acciones y precio.
   ============================================================ */
.pp {
    --pp-ink: #1C1917;
    --pp-muted: #78716C;
    --pp-line: #E7E5E4;
    --pp-soft: #F5F5F4;
    --pp-card: #FFFFFF;
    --pp-acento: var(--catalog-primary, #EA580C);
    --pp-acento-deep: var(--catalog-primary-deep, #C2410C);
    --pp-acento-rgb: var(--catalog-primary-rgb, 234, 88, 12);
    --pp-ok: #15803D;
    --pp-star: #F59E0B;
    max-width: 1240px;
    margin: 0 auto;
    padding: 8px 0 72px;
    color: var(--pp-ink);
}
.pp *, .pp *::before, .pp *::after { box-sizing: border-box; }
.pp h1, .pp h2 { color: var(--pp-ink); }

/* Ruta */
.pp-crumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .82rem; color: var(--pp-muted); margin: 0 0 18px; min-width: 0; }
.pp-crumbs a { color: inherit; text-decoration: none; font-weight: 600; }
.pp-crumbs a:hover { color: var(--pp-acento-deep); }
.pp-crumbs .bi-chevron-right { font-size: .65rem; opacity: .6; }
.pp-crumbs-actual { max-width: 38ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--pp-ink); }

/* Estructura */
.pp-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: 48px; align-items: start; }

/* Galería */
.pp-galeria { position: sticky; top: 88px; min-width: 0; }
.pp-foto { position: relative; border-radius: 22px; overflow: hidden; background: var(--pp-soft); aspect-ratio: 1 / 1; }
.pp-slides { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; outline: none; }
.pp-slides::-webkit-scrollbar { display: none; }
.pp-slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; display: grid; place-items: center; }
.pp-slide img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.pp-sin-foto { height: 100%; display: grid; place-items: center; color: #D6D3D1; font-size: 4rem; }
.pp-badges { position: absolute; top: 14px; left: 14px; z-index: 2; display: flex; gap: 6px; flex-wrap: wrap; pointer-events: none; }
.pp-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; font-size: .74rem; font-weight: 800; line-height: 1.2; }
.pp-badge--sale { background: var(--pp-acento); color: #fff; }
.pp-badge--dark { background: var(--pp-ink); color: #fff; }
.pp-badge--ok { background: #DCFCE7; color: #166534; }
.pp-flecha { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: var(--pp-ink); box-shadow: 0 4px 14px rgba(0,0,0,.12); display: grid; place-items: center; font-size: 1.1rem; opacity: 0; transition: opacity .2s ease, transform .2s ease; }
.pp-flecha--prev { left: 14px; }
.pp-flecha--next { right: 14px; }
.pp-foto:hover .pp-flecha, .pp-flecha:focus-visible { opacity: 1; }
.pp-flecha:hover { transform: translateY(-50%) scale(1.06); }
.pp-puntos { position: absolute; bottom: 14px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; z-index: 2; }
.pp-puntos span { width: 7px; height: 7px; border-radius: 99px; background: rgba(28,25,23,.22); transition: width .2s ease, background .2s ease; }
.pp-puntos span.is-on { width: 20px; background: var(--pp-ink); }
.pp-miniaturas { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; }
.pp-mini { flex: 0 0 76px; height: 76px; border-radius: 14px; border: 2px solid transparent; background: var(--pp-soft); padding: 0; overflow: hidden; cursor: pointer; transition: border-color .15s ease; }
.pp-mini img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; }
.pp-mini.is-on, .pp-mini:hover { border-color: var(--pp-ink); }

/* Compra */
.pp-compra { min-width: 0; padding-top: 4px; }
.pp-kicker { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--pp-acento-deep); min-height: 30px; }
.pp-compartir { margin-left: auto; border: 1px solid var(--pp-line); background: #fff; color: var(--pp-ink); border-radius: 999px; padding: 5px 12px; font-size: .78rem; font-weight: 700; letter-spacing: 0; text-transform: none; display: inline-flex; align-items: center; gap: 6px; }
.pp-compartir:hover { border-color: var(--pp-ink); }
.pp-titulo { font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2.15rem); line-height: 1.18; font-weight: 800; letter-spacing: -.02em; margin: 0 0 12px; overflow-wrap: anywhere; }
.pp-rating { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; text-decoration: none; color: var(--pp-muted); font-size: .9rem; margin-bottom: 18px; }
.pp-rating b { color: var(--pp-ink); }
.pp-rating:hover span:not(.pp-sep) { text-decoration: underline; }
.pp-sep { opacity: .5; }
.pp-stars { display: inline-flex; gap: 2px; color: var(--pp-star); font-size: .95rem; line-height: 1; }
.pp-stars.is-vacia { color: #D6D3D1; }
.pp-stars.is-grande { font-size: 1.25rem; gap: 3px; }
.pp-stars.is-chica { font-size: .8rem; }

.pp-precio { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 10px; }
.pp-precio-actual { font-size: clamp(1.9rem, 1.5rem + 1vw, 2.5rem); font-weight: 900; letter-spacing: -.03em; line-height: 1; color: var(--pp-ink); }
.pp-precio-antes { font-size: 1.05rem; color: var(--pp-muted); text-decoration: line-through; }
.pp-ahorro { font-size: .8rem; font-weight: 800; color: var(--pp-acento-deep); background: rgba(var(--pp-acento-rgb), .1); padding: 4px 9px; border-radius: 8px; }

.pp-stock { display: flex; align-items: center; gap: 8px; font-size: .88rem; font-weight: 700; color: var(--pp-ok); margin-bottom: 20px; }
.pp-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 18%, transparent); }
.pp-stock.is-poco { color: #C2410C; }
.pp-stock.is-agotado { color: #B91C1C; }

.pp-acciones { display: flex; gap: 10px; margin: 0 0 10px; }
.pp-qty { display: inline-flex; align-items: center; border: 1.5px solid var(--pp-line); border-radius: 14px; background: #fff; flex: 0 0 auto; }
.pp-qty button { width: 44px; height: 52px; border: 0; background: transparent; color: var(--pp-ink); font-size: 1.15rem; display: grid; place-items: center; }
.pp-qty button:hover { color: var(--pp-acento-deep); }
.pp-qty output { min-width: 30px; text-align: center; font-weight: 800; font-size: 1.05rem; }
.pp-btn-carrito { flex: 1 1 auto; min-height: 54px; border: 0; border-radius: 14px; background: var(--pp-acento); color: #fff; font-weight: 800; font-size: 1rem; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 20px; box-shadow: 0 10px 24px rgba(var(--pp-acento-rgb), .28); transition: transform .15s ease, background .15s ease, box-shadow .15s ease; }
.pp-btn-carrito:hover:not(:disabled) { background: var(--pp-acento-deep); transform: translateY(-1px); }
.pp-btn-carrito:active:not(:disabled) { transform: translateY(0); }
.pp-btn-carrito:disabled { background: #D6D3D1; color: #57534E; box-shadow: none; cursor: not-allowed; }
.pp-btn-carrito.is-success { background: var(--pp-ok); box-shadow: 0 10px 24px rgba(21,128,61,.25); }
.pp-btn-checkout { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border-radius: 14px; border: 1.5px solid var(--pp-ink); color: var(--pp-ink); font-weight: 800; text-decoration: none; margin-bottom: 10px; transition: background .15s ease, color .15s ease; }
.pp-btn-checkout:hover { background: var(--pp-ink); color: #fff; }
.pp-btn-checkout[hidden] { display: none; }

.pp-info { list-style: none; margin: 18px 0 0; padding: 0; border-top: 1px solid var(--pp-line); }
.pp-info li { display: flex; gap: 14px; padding: 14px 2px; border-bottom: 1px solid var(--pp-line); font-size: .9rem; }
.pp-info i { font-size: 1.15rem; color: var(--pp-ink); margin-top: 1px; }
.pp-info b { display: block; font-size: .9rem; }
.pp-info span { color: var(--pp-muted); }

.pp-descripcion { margin-top: 24px; }
.pp-descripcion h2 { font-size: 1rem; font-weight: 800; margin: 0 0 8px; }
.pp-descripcion-texto { color: #44403C; line-height: 1.7; font-size: .95rem; overflow-wrap: anywhere; }
.pp-descripcion-texto.is-corta { max-height: 9.6em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.pp-leer-mas { border: 0; background: none; padding: 6px 0; color: var(--pp-ink); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }

/* Reseñas */
.pp-resenas { margin-top: 64px; padding-top: 40px; border-top: 1px solid var(--pp-line); }
.pp-resenas-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.pp-resenas-head h2 { font-size: clamp(1.25rem, 1.1rem + .6vw, 1.6rem); font-weight: 800; letter-spacing: -.02em; margin: 0; }
.pp-btn-sec { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1.5px solid var(--pp-ink); background: #fff; color: var(--pp-ink); font-weight: 800; font-size: .9rem; transition: background .15s ease, color .15s ease; }
.pp-btn-sec:hover { background: var(--pp-ink); color: #fff; }
.pp-resenas-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 40px; align-items: start; }
.pp-resumen { position: sticky; top: 88px; padding: 22px; border: 1px solid var(--pp-line); border-radius: 18px; background: var(--pp-card); }
.pp-resumen-num { font-size: 3.2rem; font-weight: 900; letter-spacing: -.04em; line-height: 1; margin-bottom: 6px; }
.pp-resumen-total { color: var(--pp-muted); font-size: .85rem; margin: 8px 0 16px; }
.pp-barras { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; }
.pp-barras li { display: grid; grid-template-columns: 34px 1fr 28px; align-items: center; gap: 8px; font-size: .8rem; color: var(--pp-muted); font-weight: 700; }
.pp-barras li span:last-child { text-align: right; }
.pp-barras .bi { color: var(--pp-star); font-size: .7rem; }
.pp-barra { height: 8px; border-radius: 99px; background: var(--pp-soft); overflow: hidden; }
.pp-barra span { display: block; height: 100%; border-radius: 99px; background: var(--pp-star); }
.pp-resumen-vacio { text-align: center; padding: 6px 0 4px; }
.pp-resumen-vacio i { font-size: 2rem; color: var(--pp-acento); }
.pp-resumen-vacio b { display: block; margin: 6px 0 4px; }
.pp-resumen-vacio p { color: var(--pp-muted); font-size: .88rem; margin: 0; }
.pp-resumen-nota { display: flex; gap: 8px; margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--pp-line); color: var(--pp-muted); font-size: .76rem; line-height: 1.5; }
.pp-resumen-nota i { color: var(--pp-ok); }

.pp-lista-wrap { min-width: 0; }
.pp-lista-bar { display: flex; justify-content: flex-end; margin-bottom: 4px; }
.pp-orden { display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--pp-muted); font-weight: 700; }
.pp-orden select { border: 1px solid var(--pp-line); border-radius: 10px; padding: 6px 28px 6px 10px; font-size: .85rem; font-weight: 700; color: var(--pp-ink); background-color: #fff; }
.pp-lista { list-style: none; margin: 0; padding: 0; }
.pp-resena { padding: 20px 0; border-bottom: 1px solid var(--pp-line); }
.pp-resena-top { display: flex; gap: 12px; align-items: flex-start; }
.pp-resena-top .pp-avatar { width: 40px; height: 40px; flex: 0 0 40px; font-size: .8rem; }
.pp-resena-top b { font-size: .95rem; margin-right: 6px; }
.pp-verificada { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 800; color: var(--pp-ok); }
.pp-resena-meta { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-size: .78rem; color: var(--pp-muted); }
.pp-resena-texto { margin: 12px 0 0; color: #292524; line-height: 1.65; font-size: .95rem; overflow-wrap: anywhere; }
.pp-respuesta { margin: 14px 0 0 0; padding: 12px 14px; border-radius: 12px; background: var(--pp-soft); font-size: .88rem; }
.pp-respuesta b { display: flex; gap: 6px; align-items: center; font-size: .8rem; }
.pp-respuesta p { margin: 6px 0 0; color: #44403C; line-height: 1.6; overflow-wrap: anywhere; }
.pp-mas { margin-top: 18px; }

/* Formulario de reseña */
.pp-form { border: 1.5px solid var(--pp-ink); border-radius: 18px; padding: 20px; margin-bottom: 24px; background: #fff; animation: ppEntra .25s ease; }
.pp-form[hidden], .pp-gracias[hidden] { display: none; }
@keyframes ppEntra { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.pp-form-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.pp-x { border: 0; background: var(--pp-soft); width: 34px; height: 34px; border-radius: 50%; flex: 0 0 34px; }
.pp-elegir { border: 0; padding: 0; margin: 0 0 14px; }
.pp-elegir legend { font-size: .85rem; font-weight: 800; margin-bottom: 4px; }
.pp-elegir-estrellas { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.pp-elegir-estrellas input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pp-elegir-estrellas label { font-size: 2rem; color: #D6D3D1; cursor: pointer; transition: color .1s ease, transform .1s ease; line-height: 1; }
.pp-elegir-estrellas input:checked ~ label { color: var(--pp-star); }
@media (hover: hover) {
    .pp-elegir-estrellas:hover label { color: #D6D3D1; }
    .pp-elegir-estrellas label:hover, .pp-elegir-estrellas label:hover ~ label { color: var(--pp-star); }
}
.pp-elegir-estrellas input:focus-visible + label { outline: 2px solid var(--pp-ink); outline-offset: 2px; border-radius: 6px; }
.pp-elegir-estrellas label:active { transform: scale(.9); }
.pp-elegir-ayuda { display: block; font-size: .78rem; color: var(--pp-muted); margin-top: 2px; }
.pp-campos { display: grid; gap: 14px; }
.pp-campos label { display: grid; gap: 6px; font-size: .85rem; font-weight: 800; }
.pp-campos input, .pp-campos textarea { width: 100%; max-width: 100%; border: 1.5px solid var(--pp-line); border-radius: 12px; padding: 11px 13px; font: inherit; font-weight: 500; font-size: .95rem; color: var(--pp-ink); background: #fff; transition: border-color .15s ease, box-shadow .15s ease; }
.pp-campos input:focus, .pp-campos textarea:focus { outline: none; border-color: var(--pp-ink); box-shadow: 0 0 0 3px rgba(28,25,23,.08); }
.pp-campos small { font-weight: 500; color: var(--pp-muted); font-size: .76rem; }
.pp-campos .is-error { border-color: #DC2626; }
.pp-verificar { border: 1px dashed #D6D3D1; border-radius: 12px; padding: 10px 14px; }
.pp-verificar summary { cursor: pointer; font-weight: 800; font-size: .85rem; list-style: none; display: flex; gap: 6px; align-items: center; }
.pp-verificar summary::-webkit-details-marker { display: none; }
.pp-verificar summary span { color: var(--pp-muted); font-weight: 600; }
.pp-verificar summary i { color: var(--pp-ok); }
.pp-verificar-campos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 6px; }
.pp-trampa { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.pp-form-msg { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: #FEF2F2; color: #991B1B; font-size: .86rem; font-weight: 600; }
.pp-form-pie { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.pp-seguridad { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--pp-muted); font-weight: 600; }
.pp-seguridad.is-ok { color: var(--pp-ok); }
.pp-btn-enviar { flex: 0 0 auto; min-height: 48px; }
.pp-gracias { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border-radius: 14px; background: #F0FDF4; border: 1px solid #BBF7D0; color: #14532D; font-weight: 600; margin-bottom: 20px; }
.pp-gracias i { font-size: 1.3rem; color: var(--pp-ok); }

/* Relacionados */
.pp-relacionados { margin-top: 64px; }
.pp-relacionados h2 { font-size: 1.25rem; font-weight: 800; letter-spacing: -.01em; margin: 0 0 18px; }
.pp-rel-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.pp-rel { display: grid; gap: 6px; text-decoration: none; color: var(--pp-ink); min-width: 0; }
.pp-rel-foto { position: relative; aspect-ratio: 1 / 1; border-radius: 16px; background: var(--pp-soft); overflow: hidden; display: grid; place-items: center; color: #D6D3D1; font-size: 2rem; margin-bottom: 4px; }
.pp-rel-foto img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; transition: transform .3s ease; }
.pp-rel:hover .pp-rel-foto img { transform: scale(1.04); }
.pp-rel-foto .pp-badge { position: absolute; top: 10px; left: 10px; }
.pp-rel-nombre { font-size: .9rem; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pp-rel-rating { font-size: .78rem; font-weight: 700; }
.pp-rel-rating .bi { color: var(--pp-star); }
.pp-rel-rating small { color: var(--pp-muted); font-weight: 600; }
.pp-rel-precio { font-weight: 900; }

/* Barra fija en móvil */
.pp-barra-movil { display: none; }

@media (max-width: 991.98px) {
    .pp-grid { grid-template-columns: 1fr; gap: 24px; }
    .pp-galeria { position: static; }
    .pp-resenas-grid { grid-template-columns: 1fr; gap: 24px; }
    .pp-resumen { position: static; }
    .pp-rel-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
    .pp { padding-bottom: 110px; }
    .pp-crumbs { margin-bottom: 12px; }
    .pp-foto { border-radius: 18px; margin: 0 -4px; }
    .pp-flecha { display: none; }
    .pp-miniaturas { display: none; }
    .pp-resenas, .pp-relacionados { margin-top: 44px; }
    .pp-resenas { padding-top: 28px; }
    .pp-resenas-head .pp-btn-sec { width: 100%; justify-content: center; }
    .pp-rel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    .pp-verificar-campos { grid-template-columns: 1fr; }
    .pp-form { padding: 16px; }
    .pp-form-pie .pp-btn-enviar { width: 100%; }
    .pp-barra-movil {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
        display: flex; align-items: center; gap: 12px;
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
        background: rgba(255,255,255,.96); border-top: 1px solid var(--pp-line);
        -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
        transform: translateY(110%); transition: transform .25s ease;
    }
    .pp-barra-movil.is-visible { transform: none; }
    .pp-barra-movil-precio { display: grid; line-height: 1.15; }
    .pp-barra-movil-precio b { font-size: 1.15rem; font-weight: 900; }
    .pp-barra-movil-precio s { font-size: .78rem; color: var(--pp-muted); }
    .pp-barra-movil .pp-btn-carrito { min-height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
    .pp-slides { scroll-behavior: auto; }
    .pp *, .pp-barra-movil { transition: none !important; animation: none !important; }
}

/* Contenedor de la tienda más ancho solo en la vista de producto */
.tienda-vista--producto .tienda-main { max-width: 1320px !important; padding: 20px 32px 48px !important; }
.tienda-vista--producto .tienda-topbar-inner { max-width: 1320px !important; padding-left: 32px; padding-right: 32px; }
.pp-btn-carrito { white-space: nowrap; }
.pp-resenas-grid.is-vacia { grid-template-columns: minmax(0, 520px); }
@media (max-width: 767.98px) {
    .tienda-vista--producto .tienda-main { padding: 10px 16px 24px !important; }
    .tienda-vista--producto .tienda-topbar-inner { padding-left: 16px; padding-right: 16px; }
    .pp-slide img { padding: 0; object-fit: cover; mix-blend-mode: normal; }
    /* WhatsApp por encima de la barra fija de compra, sin la burbuja de texto */
    .tienda-vista--producto .wa-fab-wrap { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); right: 14px; }
    .tienda-vista--producto .wa-fab-bubble { display: none; }
    .pp-resenas-grid.is-vacia { grid-template-columns: 1fr; }
}
.pp-resena-top .pp-avatar { display: grid; place-items: center; border-radius: 50%; background: var(--av, #A8A29E); color: #fff; font-weight: 800; letter-spacing: .02em; }
/* Sin reseñas: la tarjeta no queda fija y se aparta mientras se escribe */
.pp-resenas-grid.is-vacia .pp-resumen { position: static; }
.pp-resenas-grid.is-vacia.is-escribiendo .pp-resumen { display: none; }
