/* tienda.css — vitrina /tienda (M-096). Se apoya en los tokens de guias.css. */
.envoltura.ancha { max-width: 1120px; }

.menu-carrito { font-weight: 600; color: var(--tinta) !important; }
.contador { display: inline-block; min-width: 1.5em; padding: 0 6px; border-radius: 999px; background: var(--acento); color: #fff; font-size: .8rem; text-align: center; line-height: 1.5; }

.filtros { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 22px; }
.filtro { padding: 6px 14px; border: 1px solid var(--linea); border-radius: 999px; text-decoration: none; color: var(--tinta-suave); background: var(--superficie); font-size: .9rem; }
.filtro.activo, .filtro:hover { border-color: var(--acento); color: var(--acento); }

.vitrina { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.producto { background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio); overflow: hidden; display: flex; flex-direction: column; }
.producto-foto { position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden; background: var(--fondo); }
.producto-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sello { position: absolute; top: 10px; left: 10px; background: var(--tinta); color: var(--superficie); font-size: .75rem; padding: 3px 10px; border-radius: 999px; }
.producto-info { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.producto-cat { margin: 0; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--tinta-suave); }
.producto-nombre { font-size: 1.05rem; margin: 0; }
.producto-nombre a { color: var(--tinta); text-decoration: none; }
.producto-nombre a:hover { color: var(--acento); }
.precio { margin: 2px 0 10px; font-weight: 700; font-size: 1.05rem; }
.precio.grande { font-size: 1.5rem; margin: 6px 0 16px; }
.moneda { font-weight: 400; font-size: .8em; color: var(--tinta-suave); }
.boton { border: 0; cursor: pointer; font-family: inherit; }
.boton-carrito { margin-top: auto; align-self: flex-start; }
.boton.agregado { background: var(--acento-fuerte); }

.ficha { display: grid; gap: 28px; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
.ficha-principal { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--radio); border: 1px solid var(--linea); background: var(--superficie); }
.miniaturas { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.miniatura { padding: 0; border: 1px solid var(--linea); border-radius: 8px; overflow: hidden; background: none; cursor: pointer; width: 72px; height: 72px; }
.miniatura img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ficha-datos h1 { margin-bottom: 0; }
.ficha-datos h2 { font-size: 1.1rem; margin-top: 1.4rem; }
.variantes { border: 0; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.variantes legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.variantes .requerido { font-weight: 400; font-size: .85em; opacity: .75; }
.variante-opcion { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid currentColor; border-radius: 8px; cursor: pointer; }
.variante-opcion:has(input:checked) { outline: 2px solid currentColor; font-weight: 600; }
.variantes .error { flex-basis: 100%; margin: 4px 0 0; }
.linea-variante { display: block; font-size: .9em; opacity: .8; }
.comprar { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 18px; }
.cantidad { display: flex; flex-direction: column; font-size: .85rem; color: var(--tinta-suave); }
.cantidad input { width: 80px; }
.aviso { color: var(--tinta-suave); font-weight: 600; }

input, select { font: inherit; color: var(--tinta); background: var(--superficie); border: 1px solid var(--linea); border-radius: 8px; padding: 8px 10px; }
input:focus { outline: 2px solid var(--acento); outline-offset: 1px; }

.carrito { display: grid; gap: 28px; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
.lineas { list-style: none; margin: 0; padding: 0; }
.linea { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--linea); }
.linea img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; background: var(--superficie); }
.linea-nombre { margin: 0; font-weight: 600; }
.linea-controles { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: .9rem; }
.linea-controles input { width: 64px; padding: 4px 6px; }
.quitar { background: none; border: 0; color: var(--tinta-suave); text-decoration: underline; cursor: pointer; font: inherit; font-size: .85rem; padding: 0; }
.total { font-size: 1.2rem; margin: 16px 0 4px; }
.carrito-envio { background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio); padding: 4px 20px 20px; }
.carrito-envio form { display: flex; flex-direction: column; gap: 12px; }
.carrito-envio label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; color: var(--tinta-suave); }
.carrito-envio .casilla { flex-direction: row; align-items: flex-start; gap: 8px; }
.casilla input { margin-top: 5px; }
.error { color: #b3261e; margin: 0; font-size: .9rem; }
@media (prefers-color-scheme: dark) { .error { color: #f2b8b5; } }
.boton-pagar { width: 100%; padding: 14px; font-size: 1rem; }
.boton-pagar[disabled] { opacity: .6; cursor: wait; }

.ayuda-flotante { position: fixed; right: 18px; bottom: 18px; z-index: 20; background: var(--tinta); color: var(--superficie); padding: 12px 18px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: .9rem; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); }
.ayuda-flotante:hover { background: var(--acento); color: #fff; }

/* ── Portada (/) · misma paleta y tipografía de la tienda ── */
.hero { text-align: center; padding: 56px 0 44px; }
.hero-marca { margin: 0 0 10px; font: 700 .95rem/1 Georgia, "Times New Roman", serif; letter-spacing: .4em; color: var(--acento); }
.hero h1 { font-size: 2.6rem; max-width: 18ch; margin: 0 auto 14px; }
.hero .bajada { max-width: 46ch; margin: 0 auto 24px; }
.tiles { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 8px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 28px 24px; border: 1px solid var(--linea); border-radius: var(--radio); background: var(--superficie); text-decoration: none; color: var(--tinta); }
.tile:hover { border-color: var(--acento); }
.tile-nombre { font: 700 1.3rem/1.3 Georgia, "Times New Roman", serif; }
.tile-texto { color: var(--tinta-suave); font-size: .95rem; }
.seccion { margin-top: 48px; }
.seccion-cab { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.seccion-cab h2 { margin: 0 0 14px; }
.seccion-cab a { font-size: .95rem; white-space: nowrap; }
.confianza { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 48px; padding: 24px 0; border-top: 1px solid var(--linea); border-bottom: 1px solid var(--linea); text-align: center; }
.confianza strong { display: block; font-family: Georgia, "Times New Roman", serif; }
.confianza span { font-size: .9rem; color: var(--tinta-suave); }

@media (max-width: 760px) {
    .hero { padding: 36px 0 32px; }
    .hero h1 { font-size: 1.9rem; }
    .confianza { grid-template-columns: 1fr; }
    .ficha, .carrito { grid-template-columns: 1fr; }
    .vitrina { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .producto-info { padding: 10px 12px 14px; }
    .ayuda-flotante { right: 12px; bottom: 12px; padding: 10px 14px; font-size: .85rem; }
}

/* ── Buscador de productos (esquina inferior derecha) ── */
.asistente { position: fixed; right: 16px; bottom: 16px; z-index: 30; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; max-width: calc(100vw - 32px); }
.asistente-boton { background: var(--tinta); color: var(--superficie); border: 0; padding: 12px 18px; border-radius: 999px; font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); }
.asistente-boton:hover, .asistente-boton:focus-visible { background: var(--acento); color: #fff; }
.asistente-panel { width: 340px; max-width: 100%; max-height: min(70vh, 480px); display: flex; flex-direction: column; background: var(--superficie); color: var(--tinta); border: 1px solid var(--linea); border-radius: var(--radio); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); overflow: hidden; }
.asistente-panel[hidden] { display: none; }
.asistente-cab { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--linea); font-family: Georgia, "Times New Roman", serif; }
.asistente-cerrar { background: none; border: 0; color: var(--tinta-suave); font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 0 4px; }
.asistente-cerrar:hover { color: var(--acento); }
.asistente-mensajes { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-height: 80px; }
.asistente-msg { margin: 0; padding: 8px 12px; border-radius: 12px; background: var(--fondo); font-size: .9rem; max-width: 90%; overflow-wrap: anywhere; }
.asistente-msg.propia { align-self: flex-end; background: var(--acento); color: #fff; }
.asistente-ficha { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--linea); border-radius: 10px; text-decoration: none; color: var(--tinta); background: var(--superficie); }
.asistente-ficha:hover, .asistente-ficha:focus-visible { border-color: var(--acento); }
.asistente-ficha img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; flex: none; background: var(--fondo); }
.asistente-ficha > span { display: flex; flex-direction: column; min-width: 0; }
.asistente-nombre { font-size: .88rem; font-weight: 600; overflow-wrap: anywhere; }
.asistente-precio { font-size: .85rem; color: var(--tinta-suave); }
.asistente-form { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--linea); }
.asistente-form input { flex: 1; min-width: 0; }
.asistente-form .boton { padding: 8px 14px; }
@media (max-width: 760px) { .asistente { right: 16px; bottom: 12px; } }

/* ── Ficha de producto: campos opcionales (titular, beneficios, FAQ, video, confianza) ── */
.titular-beneficio { margin: 4px 0 6px; font-size: 1.05rem; font-weight: 600; color: var(--acento); }
.beneficios { margin: 0 0 16px; padding-left: 1.2em; }
.beneficios li { margin: 3px 0; }
.ficha-video { display: block; width: 100%; max-width: 100%; margin-top: 12px; border-radius: var(--radio); border: 1px solid var(--linea); background: #000; }
.confianza-ficha { list-style: none; margin: 0 0 18px; padding: 12px 14px; display: grid; gap: 4px; border: 1px solid var(--linea); border-radius: var(--radio); background: var(--superficie); font-size: .9rem; }
.confianza-ficha li::before { content: "✓ "; color: var(--acento); font-weight: 700; }
.faq { margin-top: 1.4rem; }
.faq-item { border-bottom: 1px solid var(--linea); padding: 2px 0; }
.faq-item summary { cursor: pointer; padding: 10px 0; font-weight: 600; }
.faq-item summary:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }
.faq-item p { margin: 0 0 12px; }

/* Barra de compra fija: solo en móvil */
.barra-compra { display: none; }
@media (max-width: 768px) {
    .barra-compra { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--superficie); border-top: 1px solid var(--linea); box-shadow: 0 -4px 16px rgba(0, 0, 0, .12); box-sizing: border-box; max-width: 100vw; }
    .barra-compra-datos { display: flex; flex-direction: column; min-width: 0; }
    .barra-compra-nombre { font-size: .8rem; color: var(--tinta-suave); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .barra-compra-precio { font-weight: 700; }
    .barra-compra .boton-carrito { margin-top: 0; flex: none; white-space: nowrap; }
    /* El pie y los flotantes no quedan tapados por la barra */
    body:has(.barra-compra) .pie { padding-bottom: 96px; }
    body:has(.barra-compra) .asistente, body:has(.barra-compra) .ayuda-flotante { bottom: 84px; }
}
