/* Catálogo web · Opción A (grilla oscura). Colores de src/ui/tema.ts: negro #0b0c10, azul #2f6bff. */
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { background: #0b0c10; color: #f2f4f8; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; min-height: 100vh; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
:focus-visible { outline: 2px solid #6f9bff; outline-offset: 2px; }

#app { max-width: 720px; margin: 0 auto; padding: 16px 14px 110px; }
.cargando, .mensaje { text-align: center; color: #9aa3b5; padding: 80px 20px; line-height: 1.6; font-size: 15px; }
.mensaje b { display: block; color: #f2f4f8; font-size: 18px; margin-bottom: 6px; }
.btn-reintentar { margin-top: 16px; padding: 10px 18px; border-radius: 12px; background: #2f6bff; color: #fff; font-weight: 700; }

/* Encabezado del negocio */
.neg { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.logo { width: 46px; height: 46px; border-radius: 14px; background: #1c2a52; color: #9fbcff; display: grid; place-items: center; font-weight: 800; font-size: 18px; flex-shrink: 0; }
.neg h1 { font-size: 20px; font-weight: 800; line-height: 1.2; }
.neg p { font-size: 12.5px; color: #9aa3b5; }

/* Buscador y categorías */
.buscar { width: 100%; height: 42px; border-radius: 12px; background: #171a22; border: 1px solid #2a2f3b; padding: 0 14px; font-size: 14.5px; margin-bottom: 10px; }
.buscar::placeholder { color: #6c7486; }
.chips { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { padding: 7px 13px; border-radius: 999px; font-size: 13px; font-weight: 600; background: #171a22; border: 1px solid #2a2f3b; color: #c9d0dd; white-space: nowrap; }
.chip[aria-pressed="true"] { background: #1c2a52; border-color: #2f6bff; color: #9fbcff; }

/* Grilla */
.grilla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 560px) { .grilla { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { background: #14171f; border: 1px solid #222734; border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; text-align: left; }
.card .foto { aspect-ratio: 1 / 1; width: 100%; position: relative; background: #1e222c; }
.card .foto .sin-foto { position: absolute; inset: 0; }
.card .foto .badge { z-index: 2; }
.card .foto .badge { position: absolute; top: 8px; left: 8px; }
.card.agotado .foto img { filter: grayscale(.9) brightness(.7); }
.card .cb { padding: 9px 10px 10px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .n { text-align: left; font-size: 13.5px; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .row { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.card .p { font-size: 14.5px; font-weight: 800; }
.add { width: 32px; height: 32px; border-radius: 10px; background: #2f6bff; color: #fff; font-weight: 800; font-size: 18px; display: grid; place-items: center; }
.add:disabled { background: #2a2f3b; color: #6c7486; cursor: default; }
.sin-foto { width: 100%; height: 100%; display: grid; place-items: center; color: #4a5160; font-size: 12px; }
.vacio { grid-column: 1 / -1; text-align: center; color: #9aa3b5; padding: 40px 10px; font-size: 14px; }

.badge { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 7px; white-space: nowrap; }
.b-ago { background: #3a1414; color: #ff8d8d; }
.b-quedan { background: #3a2c0c; color: #ffcc66; }

.pie { text-align: center; color: #6c7486; font-size: 12px; padding: 28px 0 8px; line-height: 1.8; }
.pie a { color: #9aa3b5; font-weight: 700; text-decoration: none; }

/* Barra del carrito */
.barra { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(14px, env(safe-area-inset-bottom)); width: calc(100% - 28px); max-width: 692px; height: 54px; border-radius: 16px; background: #2f6bff; color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; font-size: 15px; font-weight: 700; box-shadow: 0 8px 24px rgba(47,107,255,.4); z-index: 10; }
.barra .cnt { background: #fff; color: #2f6bff; border-radius: 8px; padding: 2px 8px; font-size: 13px; margin-right: 8px; }

/* Hojas (detalle y carrito) */
.velo { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.hoja { background: #14171f; width: 100%; max-width: 720px; max-height: 92vh; border-radius: 22px 22px 0 0; padding: 10px 16px max(16px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; overflow-y: auto; }
.hoja-cab { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.asa { width: 40px; height: 4px; border-radius: 4px; background: #3a4152; margin: 0 auto 10px; flex-shrink: 0; }
.cerrar { width: 34px; height: 34px; border-radius: 10px; background: #1e222c; font-size: 18px; color: #c9d0dd; }
.hoja h2 { font-size: 18px; font-weight: 800; }

.fotos { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: 16px; margin-bottom: 12px; flex-shrink: 0; scrollbar-width: none; }
.fotos::-webkit-scrollbar { display: none; }
.fotos > .foto-zoom, .fotos > .sin-foto { flex: 0 0 100%; aspect-ratio: 1 / 1; max-height: 52vh; scroll-snap-align: center; border-radius: 16px; overflow: hidden; position: relative; background: #1e222c; cursor: zoom-in; }
.lupa { position: absolute; right: 10px; bottom: 10px; z-index: 2; width: 34px; height: 34px; border-radius: 10px; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; font-size: 17px; }

/* Foto completa sin recortar, con fondo difuminado de la misma foto */
.ajuste { position: absolute; inset: 0; overflow: hidden; background: #1e222c; }
.ajuste img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ajuste .fondo { object-fit: cover; filter: blur(18px) brightness(.7); transform: scale(1.15); }
.ajuste .frente { object-fit: contain; }
.card.agotado .ajuste .frente { filter: grayscale(.9) brightness(.7); }
.card.agotado .ajuste .fondo { filter: blur(18px) grayscale(.9) brightness(.5); }

/* Visor de fotos con zoom */
.visor { position: fixed; inset: 0; z-index: 40; background: #000; display: flex; align-items: center; justify-content: center; }
.visor-zona { position: absolute; inset: 0; overflow: hidden; touch-action: none; display: flex; align-items: center; justify-content: center; }
.visor-img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; transform-origin: center center; will-change: transform; }
.visor-cerrar { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px; width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,.14); color: #fff; font-size: 20px; z-index: 2; }
.visor-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 56px; border-radius: 12px; background: rgba(255,255,255,.14); color: #fff; font-size: 30px; z-index: 2; }
.visor-nav:disabled { opacity: .25; cursor: default; }
.visor-nav.izq { left: 10px; }
.visor-nav.der { right: 10px; }
.visor-cont { position: absolute; top: max(24px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); color: #fff; font-size: 14px; font-weight: 700; z-index: 2; }
.visor-ayuda { position: absolute; bottom: max(18px, env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; color: rgba(255,255,255,.6); font-size: 12.5px; pointer-events: none; z-index: 2; }
.puntos { display: flex; justify-content: center; gap: 4px; margin: -4px 0 10px; }
.punto { width: 22px; height: 22px; display: grid; place-items: center; }
.punto::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #3a4152; }
.punto[aria-current="true"]::after { background: #2f6bff; width: 18px; border-radius: 4px; }
.det-n { font-size: 18px; font-weight: 800; line-height: 1.3; margin-bottom: 4px; }
.det-p { font-size: 20px; font-weight: 800; color: #6f9bff; margin-bottom: 8px; }
.det-d { font-size: 14px; color: #b4bccb; line-height: 1.55; margin-bottom: 14px; white-space: pre-line; overflow-wrap: anywhere; }
.det-acc { display: flex; gap: 10px; margin-top: auto; padding-top: 6px; }

.qty { display: flex; align-items: center; background: #171a22; border: 1px solid #2a2f3b; border-radius: 12px; overflow: hidden; flex-shrink: 0; }
.qty button { width: 38px; height: 40px; font-size: 18px; font-weight: 800; }
.qty button:disabled { color: #4a5160; cursor: default; }
.qty span { min-width: 28px; text-align: center; font-weight: 700; }
.qty.chica button { width: 32px; height: 34px; }

.btn { height: 48px; border-radius: 14px; background: #2f6bff; color: #fff; font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; flex: 1; padding: 0 12px; }
.btn:disabled { background: #2a2f3b; color: #6c7486; cursor: default; }
.btn.wsp { background: #1f9d55; width: 100%; flex: none; }
.btn.wsp:disabled { background: #2a2f3b; color: #6c7486; }

.linea { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #1e222c; }
.linea img, .linea .sin-foto { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: #1e222c; }
.linea .i { flex: 1; min-width: 0; }
.linea .i b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.linea .i span { font-size: 12px; color: #9aa3b5; }
.campo { margin-top: 12px; }
.campo label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.campo label .req { color: #ff8d8d; }
.campo label .opc { color: #9aa3b5; font-weight: 400; }
.campo input, .campo textarea { width: 100%; border-radius: 12px; background: #171a22; border: 1px solid #2a2f3b; padding: 10px 12px; font-size: 15px; }
.campo textarea { min-height: 64px; resize: vertical; }
.campo .error { color: #ff8d8d; font-size: 12px; margin-top: 4px; }
.total { display: flex; justify-content: space-between; font-size: 17px; font-weight: 800; padding: 14px 0 8px; }
.aviso { font-size: 12px; color: #9aa3b5; line-height: 1.5; margin-bottom: 12px; }

/* Páginas legales (/privacidad, /terminos, /eliminar-cuenta) */
.legal { max-width: 720px; margin: 0 auto; padding: 24px 18px 60px; color: #c9d0dd; font-size: 15px; line-height: 1.65; }
.legal h1 { color: #f2f4f8; font-size: 26px; line-height: 1.25; margin-bottom: 4px; }
.legal h2 { color: #f2f4f8; font-size: 18px; margin: 26px 0 6px; }
.legal p, .legal ul { margin-bottom: 10px; }
.legal ul { padding-left: 20px; }
.legal li { margin-bottom: 4px; }
.legal a { color: #6f9bff; }
.legal .fecha { color: #9aa3b5; font-size: 13px; margin-bottom: 18px; }
.legal .resumen { background: #14171f; border: 1px solid #222734; border-radius: 14px; padding: 14px 16px; margin: 14px 0 6px; }
.legal .pendiente { background: #3a2c0c; color: #ffcc66; padding: 0 5px; border-radius: 5px; font-weight: 700; }
.legal .borrador { background: #3a2c0c; color: #ffcc66; border-radius: 12px; padding: 10px 14px; font-size: 13.5px; font-weight: 600; margin-bottom: 16px; }
.legal nav { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; border-top: 1px solid #222734; padding-top: 16px; margin-top: 30px; }

/* Encabezado del negocio: portada + logo redondo sobre el borde (opción A) */
.perfil { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 16px; }
.portada { width: 100%; aspect-ratio: 3 / 1; border-radius: 16px; overflow: hidden; background: #14171f; }
.portada.vacia { background: linear-gradient(135deg, #14171f, #1c2a52); }
.portada img { width: 100%; height: 100%; object-fit: cover; display: block; }
.perfil-logo { width: 88px; height: 88px; margin-top: -44px; border-radius: 50%; border: 4px solid #0b0c10; background: #1c2a52; color: #9fbcff; display: grid; place-items: center; font-weight: 800; font-size: 28px; overflow: hidden; position: relative; }
.perfil-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.perfil h1 { font-size: 22px; font-weight: 800; line-height: 1.2; margin-top: 8px; }
.perfil p { font-size: 13px; color: #9aa3b5; }
