/* Tienda en línea · tema claro, sobrio, centrado en las fotos del producto. Sin dependencias. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../backoffice/fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../backoffice/fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  --ink: #1a1a1a;
  --ink-2: #5c5c5c;
  --ink-3: #6b6b6b;
  --line: #e5e5e2;
  --line-strong: #c9c9c4;
  --bg: #ffffff;
  --soft: #f5f5f2;
  --sale: #b42318;
  --ok: #0b6b3a;
  --warn: #8a5a00;
  --info-bg: #eef5fd;
  --info: #0b4a7a;
  --error-bg: #fdecea;
  --radius: 10px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  /* Marca de la tienda: `tema.css` (se enlaza después de este archivo) pone los de cada tienda. */
  --brand: #1a1a1a;
  --brand-hover: #333333;
  --on-brand: #ffffff;
  --accent: #0b6b3a;
  --on-accent: #ffffff;
  --focus: #2463eb;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 15px/1.55 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0 0 12px; line-height: 1.2; letter-spacing: -.015em; }
h1 { font-size: clamp(24px, 4vw, 32px); font-weight: 650; }
h2 { font-size: 18px; font-weight: 650; }
p { margin: 0 0 12px; }
.muted { color: var(--ink-2); }
.fine { font-size: 13px; color: var(--ink-2); }
.lead { font-size: 16px; color: var(--ink-2); max-width: 60ch; }
.center { text-align: center; display: block; }
.r { text-align: right; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.icon { flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }

/* Botones y enlaces */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 18px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--bg); color: var(--ink);
  font: 600 15px var(--font); text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s;
}
.btn:hover { border-color: var(--ink); }
.btn-dark { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-dark:hover { background: var(--brand-hover); }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.grow { flex: 1; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link.danger { color: var(--sale); }

/* Espacios para apps */
.app-bar { display: block; text-align: center; padding: 9px 16px; font-size: 14px; font-weight: 550; text-decoration: none; }
.app-bar-dark { background: var(--ink); color: #fff; }
.app-bar-light { background: var(--soft); color: var(--ink); border-bottom: 1px solid var(--line); }
.app-bar-accent { background: var(--accent); color: var(--on-accent); }
a.app-bar:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Encabezado */
.test-strip { background: var(--ink); color: #f1f1f1; text-align: center; font-size: 12.5px; padding: 6px 12px; }
.site-head { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 30; }
.head-row { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.logo-img { height: 48px; width: auto; max-width: 200px; object-fit: contain; }
.logo { font-weight: 750; font-size: 20px; letter-spacing: -.02em; text-decoration: none; white-space: nowrap; }
.site-search { flex: 1; max-width: 460px; margin-left: auto; position: relative; }
.site-search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.site-search input { width: 100%; height: 42px; border: 1px solid var(--line); background: var(--soft); border-radius: 999px; padding: 0 16px 0 40px; font: inherit; }
.site-search input:focus { background: var(--bg); border-color: var(--ink); outline: 2px solid var(--focus); outline-offset: 2px; }
.head-actions { display: flex; align-items: center; gap: 4px; }
.head-link { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 999px; text-decoration: none; font-weight: 550; position: relative; }
.head-link:hover { background: var(--soft); }
.cart-link .count { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; border-radius: 9px; background: var(--brand); color: var(--on-brand); font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.cat-nav { display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; padding-bottom: 12px; }
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav a { text-decoration: none; color: var(--ink-2); font-weight: 550; white-space: nowrap; padding: 2px 0; border-bottom: 2px solid transparent; }
.cat-nav a:hover, .cat-nav a[aria-current] { color: var(--ink); border-color: var(--ink); }
/* El acento es un detalle de identidad (ADR 0018): raya de los títulos, elemento activo del menú y filete del pie. Nunca botones, ofertas ni errores. */
:is(.theme-retail, .theme-restaurant) .cat-nav a[aria-current] { border-color: var(--accent); }
:is(.theme-retail, .theme-restaurant) .site-foot { border-top: 3px solid var(--accent); }
.mobile-nav { display: none; }
@media (max-width: 760px) {
  .head-row { flex-wrap: wrap; gap: 8px 12px; padding-top: 10px; padding-bottom: 10px; min-height: 0; }
  .logo { flex: 1; font-size: 18px; }
  .logo-img { height: 44px; max-width: 170px; }
  .site-search { order: 3; flex-basis: 100%; max-width: none; }
  .head-link span:not(.count) { display: none; }
  .cat-nav { display: none; }
  .mobile-nav { display: block; position: relative; }
  .mobile-nav summary { list-style: none; cursor: pointer; padding: 6px; display: flex; }
  .mobile-nav summary::-webkit-details-marker { display: none; }
  .mobile-nav .drawer { position: absolute; top: 44px; left: 0; width: min(280px, 80vw); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0, 0, 0, .12); padding: 8px; display: flex; flex-direction: column; z-index: 40; }
  .mobile-nav .drawer a { padding: 12px; text-decoration: none; font-weight: 550; border-radius: 8px; }
  .mobile-nav .drawer a:hover { background: var(--soft); }
}

.site-main { padding-top: 28px; padding-bottom: 64px; min-height: 60vh; }
.flash { list-style: none; padding: 0; margin: 0 0 20px; }
.flash li { padding: 12px 16px; border-radius: var(--radius); background: var(--soft); margin-bottom: 8px; }
.flash .success { background: #e8f5ee; color: var(--ok); }
.flash .error { background: var(--error-bg); color: var(--sale); }

/* Portada */
.hero { background: color-mix(in oklab, var(--brand) 7%, var(--bg)); padding: clamp(32px, 7vw, 80px) clamp(20px, 6vw, 64px); margin-bottom: 48px; }
.hero h1 { font-size: clamp(32px, 6vw, 56px); letter-spacing: -.03em; margin-bottom: 24px; max-width: 24ch; }
.hero-img { position: relative; overflow: hidden; display: flex; align-items: flex-end; min-height: clamp(320px, 48vw, 520px); background: var(--ink); }
.hero-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .72), rgba(0, 0, 0, .58)); }
.hero-text { position: relative; z-index: 1; }
.hero-img h1 { color: #fff; }
.section { margin-bottom: 48px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-head h2 { font-size: 22px; margin: 0; }
:is(.theme-retail, .theme-restaurant) .section-head h2::after { content: ""; display: block; width: 40px; height: 3px; margin-top: 8px; background: var(--accent); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.tile { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; font-weight: 600; }
.tile:hover { border-color: var(--ink); }

/* Colecciones y marcas */
.collections { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.collection-tile { position: relative; display: block; aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; background: var(--soft); text-decoration: none; }
.collection-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.collection-tile:hover img { transform: scale(1.03); }
.collection-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 45%, rgba(0, 0, 0, .55)); }
.collection-name { position: absolute; left: 18px; bottom: 14px; z-index: 1; color: #fff; font-size: 20px; font-weight: 650; letter-spacing: -.01em; }
.banner { position: relative; width: 100%; border-radius: 16px; overflow: hidden; margin-bottom: 28px; aspect-ratio: 21 / 7; min-height: 200px; background: var(--soft); }
.banner img { width: 100%; height: 100%; object-fit: cover; }
.banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, .55), transparent 70%); }
.banner-text { position: absolute; left: clamp(20px, 5vw, 48px); bottom: clamp(20px, 4vw, 40px); z-index: 1; color: #fff; max-width: 52ch; }
.banner-text h1 { color: #fff; margin-bottom: 6px; }
.banner-text p { margin: 0; opacity: .9; }
.brand-logo { max-height: 56px; width: auto; margin-bottom: 12px; }
.brand-link { display: inline-block; font-size: 13px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); text-decoration: none; margin-bottom: 6px; }
.brand-link:hover { color: var(--ink); }

/* Tarjetas de producto */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 28px 20px; }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr 1fr; gap: 20px 12px; } }
.card { display: flex; flex-direction: column; gap: 6px; }
.card-link { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 10px; }
.card-img { position: relative; aspect-ratio: 1; background: var(--soft); border-radius: var(--radius); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: opacity .25s; }
.card-img img.alt { position: absolute; inset: 0; opacity: 0; }
.card:hover .card-img img.alt { opacity: 1; }
.card-img.swapped img.alt { display: none; }
.no-img { position: relative; width: 100%; height: 100%; display: block; background: var(--soft); border-radius: inherit; color: var(--ink-3); }
/* Marcador de «sin imagen» (también cuando el archivo no carga): un cuadro con un monte, sin texto que se encime con las etiquetas. */
.no-img::before, .img-failed::before { content: ""; position: absolute; left: 50%; top: 50%; width: 34%; max-width: 64px; aspect-ratio: 4 / 3; transform: translate(-50%, -50%); box-sizing: border-box; border: 2px solid currentColor; border-radius: 4px; background: linear-gradient(135deg, transparent 52%, currentColor 52%); opacity: .45; pointer-events: none; }
.img-failed { position: relative; background: var(--soft); color: var(--ink-3); }
img[data-failed] { opacity: 0; transition: none; }
.card-img img.alt[data-failed] { display: none; }
.tag { position: absolute; top: 10px; left: 10px; background: var(--bg); color: var(--ink); font-size: 12px; font-weight: 650; padding: 3px 9px; border-radius: 999px; box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }
.tag.sale { background: var(--sale); color: #fff; }
.card-body { display: flex; flex-direction: column; gap: 2px; }
.card-name { font-weight: 550; }
.card-add { margin: 0; }
.card-add-btn { width: 100%; min-height: 40px; padding: 6px 10px; font-size: 14px; }
.card:hover .card-name { text-decoration: underline; text-underline-offset: 3px; }
.card-price { font-variant-numeric: tabular-nums; }
.card-price .sale, .price.sale { color: var(--sale); }
.card-price s { color: var(--ink-3); font-size: 13px; }
.swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 0 2px; margin: 0 -6px; }
.swatch { min-width: 40px; min-height: 40px; padding: 0; border: 0; background: none; display: grid; place-items: center; cursor: pointer; font: inherit; color: var(--ink); }
.swatch-dot { display: block; width: 26px; height: 26px; border-radius: 50%; overflow: hidden; border: 2px solid var(--line-strong); background: var(--soft); box-sizing: border-box; }
.swatch-dot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.swatch-name { display: block; padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 12px; font-weight: 550; line-height: 1.2; }
.swatch:hover .swatch-dot, .swatch:hover .swatch-name, .swatch[aria-pressed=true] .swatch-dot, .swatch[aria-pressed=true] .swatch-name { border-color: var(--ink); }
.swatch:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: 8px; }
.swatch-more { min-height: 40px; display: grid; place-items: center; padding: 0 6px; font-size: 13px; color: var(--ink-2); }

/* Listado */
.page-title { margin-bottom: 20px; }
.page-title.row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.crumbs { font-size: 13px; color: var(--ink-2); margin-bottom: 12px; }
.crumbs a { color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip { padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-weight: 550; font-size: 14px; }
.chip:hover { border-color: var(--ink); }
.list-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; margin-bottom: 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.list-bar { flex-wrap: wrap; }
.sort { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
select, input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input:not([type]), textarea {
  font: inherit; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 12px; background: var(--bg); width: 100%; min-height: 44px;
}
.sort select { width: auto; min-height: 36px; padding: 6px 10px; }
/* iOS hace zoom al enfocar un campo con letra menor de 16 px (A3). */
@media (max-width: 719px) { input:not([type=radio]):not([type=checkbox]), select, textarea, .sort, .sort select { font-size: 16px; } }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 40px; }
.empty { text-align: center; padding: 64px 16px; }
.empty strong { display: block; font-size: 18px; margin-bottom: 8px; }

/* Producto */
.product { display: grid; gap: 40px; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 860px) { .product { grid-template-columns: 1fr; gap: 24px; } }
.product.product-nogallery { grid-template-columns: minmax(0, 680px); justify-content: center; } /* sin fotos: una columna, sin galería (#155) */
.gallery { position: sticky; top: 140px; }
@media (max-width: 860px) { .gallery { position: static; } }
/* La imagen principal marca la altura (sin cuadro fijo con object-fit: contain, que dejaba bandas del fondo); el cuadro solo se fija cuando no hay imagen que mostrar. */
.gallery-main { background: var(--bg); border-radius: 14px; overflow: hidden; }
.gallery-main img { display: block; width: 100%; height: auto; max-height: 80vh; object-fit: contain; }
.gallery-main .no-img { height: auto; aspect-ratio: 1; }
.gallery-main.img-failed { aspect-ratio: 1; background: var(--soft); }
.thumbs[hidden], .no-img[hidden] { display: none; }
.thumbs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; }
.thumbs button { flex: 0 0 72px; height: 72px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: var(--soft); cursor: pointer; }
.thumbs button[aria-current] { border-color: var(--ink); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.buy h1 { margin-bottom: 8px; }
.price-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.price { font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; }
.was { color: var(--ink-3); font-size: 16px; }
.buy-form { margin: 20px 0 12px; display: flex; flex-direction: column; gap: 16px; }
.opt { border: 0; padding: 0; margin: 0; }
.opt legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.opt legend span { font-weight: 450; color: var(--ink-2); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill span { display: inline-flex; align-items: center; min-height: 40px; min-width: 48px; justify-content: center; padding: 6px 14px; border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; font-weight: 550; }
.pill-color { display: inline-block; width: 16px; height: 16px; margin: 0 8px 0 -4px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .3); box-sizing: border-box; flex: none; }
.pill input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.pill input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.pill.unavailable span { color: var(--ink-3); text-decoration: line-through; }
.stock { margin: 0; font-weight: 550; }
.stock .ok { color: var(--ok); }
.stock .low { color: var(--warn); }
.stock .out { color: var(--sale); }
.buy-row { display: flex; gap: 10px; }
.qty input { width: 84px; text-align: center; border-radius: 999px; }
.form-error { color: var(--sale); font-size: 14px; display: block; margin: 0; }
.desc { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 20px; color: #333; }
.desc h2 { font-size: 16px; }
.specs { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 0; }
.specs dt { color: var(--ink-2); }
.specs dd { margin: 0; }

/* Carrito y pago */
.cart-layout, .checkout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; align-items: start; }
@media (max-width: 900px) { .cart-layout, .checkout { grid-template-columns: 1fr; gap: 24px; } }
.cart-lines { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.cart-line { display: grid; grid-template-columns: 96px 1fr auto; gap: 16px; width: 100%; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.cart-line.has-problem .line-img { opacity: .6; }
.line-img { width: 96px; height: 96px; border-radius: 8px; overflow: hidden; background: var(--soft); }
.line-img img { width: 100%; height: 100%; object-fit: cover; }
.line-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.line-name { font-weight: 600; text-decoration: none; }
.line-actions { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.line-total { font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .cart-line { grid-template-columns: 72px 1fr; } .line-img { width: 72px; height: 72px; } .line-total { grid-column: 2; } }
.summary { background: var(--soft); border-radius: 14px; padding: 24px; position: sticky; top: 140px; display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 900px) { .summary { position: static; } }
.summary h2 { margin: 0; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 8px 0; margin: 0; font-variant-numeric: tabular-nums; }
.totals dt { padding-right: 16px; }
.totals dd { margin: 0; text-align: right; }
.totals .grand { font-weight: 700; font-size: 17px; padding-top: 10px; border-top: 1px solid var(--line-strong); }
.mini-lines { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.mini-lines li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; font-size: 14px; }
.mini-img { position: relative; width: 56px; height: 56px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); }
.mini-img.img-failed { background: var(--soft); }
.mini-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.mini-img b { position: absolute; top: -8px; right: -8px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--ink-2); color: #fff; font-size: 11px; display: grid; place-items: center; padding: 0 5px; }
.mini-qty { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.checkout-main { display: flex; flex-direction: column; gap: 16px; }
/* Resumen plegable arriba del formulario, solo cuando la página va en una columna (M18). */
.summary-fold { display: none; background: var(--soft); border-radius: 14px; padding: 14px 16px; }
.summary-fold summary { display: flex; justify-content: space-between; gap: 12px; cursor: pointer; font-weight: 550; }
.summary-fold summary::after { content: "▾"; margin-left: 8px; }
.summary-fold[open] summary::after { content: "▴"; }
.summary-fold summary > span { margin-right: auto; }
.summary-fold .mini-lines { margin-top: 14px; }
@media (max-width: 900px) { .summary-fold { display: block; } }
.box { border: 1px solid var(--line); border-radius: 14px; padding: 24px; background: var(--bg); }
.box-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.box-head h2 { margin: 0; }
.box-head a { font-size: 14px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.fields.one { grid-template-columns: 1fr; }
.f.wide { grid-column: span 2; }
.fields.one .f.wide { grid-column: auto; }
@media (max-width: 560px) { .fields { grid-template-columns: 1fr; } .f.wide { grid-column: auto; } }
.f label { display: block; font-size: 14px; font-weight: 550; margin-bottom: 6px; }
.f.bad input, .f.bad select { border-color: var(--sale); }
.choices { display: flex; flex-direction: column; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; margin-bottom: 14px; }
.choice { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; }
.choice + .choice { border-top: 1px solid var(--line); }
.choice:has(input:checked) { background: var(--soft); }
.choice input { width: 18px; height: 18px; accent-color: var(--ink); }
.choice span:nth-of-type(2) { margin-left: auto; }
.check { display: flex; gap: 10px; align-items: center; margin: 4px 0 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }
.banner-error { background: var(--error-bg); color: var(--sale); padding: 12px 16px; border-radius: 10px; margin: 0; }
.banner-info { background: var(--info-bg); color: var(--info); padding: 12px 16px; border-radius: 10px; }

/* Confirmación */
.confirm { max-width: 860px; }
.confirm-head { display: flex; gap: 16px; align-items: center; margin-bottom: 24px; }
.confirm-head p { margin: 0; }
.confirm-head h1 { margin: 0; }
.check-badge { width: 48px; height: 48px; border-radius: 50%; background: #e8f5ee; color: var(--ok); display: grid; place-items: center; flex-shrink: 0; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); padding: 0; margin: 0 0 24px; counter-reset: s; }
.steps li { position: relative; padding-top: 20px; font-size: 13px; font-weight: 550; color: var(--ink-3); }
.steps li::before { content: ""; position: absolute; top: 4px; left: 0; right: 4px; height: 4px; border-radius: 2px; background: var(--line); }
.steps li.done { color: var(--ink); }
.steps li.done::before { background: var(--ink); }
.steps small { display: block; font-weight: 400; color: var(--ink-2); }
@media (max-width: 560px) { .steps { grid-template-columns: repeat(2, 1fr); row-gap: 12px; } }
.confirm-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 760px) { .confirm-grid { grid-template-columns: 1fr; } }
.confirm-grid .totals { margin-top: 16px; }
.refunds { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.refunds h2 { margin: 0 0 12px; }

/* Cuenta */
.narrow { max-width: 480px; margin: 0 auto; }
.narrow h1 { font-size: 26px; }
.account-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.account-grid > div { display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 860px) { .account-grid { grid-template-columns: 1fr; } }
.orders { width: 100%; border-collapse: collapse; font-size: 14px; }
.orders th { text-align: left; font-weight: 550; color: var(--ink-2); padding: 8px 0; border-bottom: 1px solid var(--line); }
.orders td { padding: 10px 0; border-bottom: 1px solid var(--line); }
.orders th.r, .orders td.r { text-align: right; }
.addr { font-size: 14px; }
.state-tag { display: inline-block; margin-top: 6px; }
.pill-tag { font-size: 12px; background: var(--soft); padding: 2px 8px; border-radius: 999px; }
.actions-row { display: flex; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 8px; }
.actions-row .link { margin-right: auto; }

/* Pie */
.site-foot { border-top: 1px solid var(--line); background: var(--soft); padding: 40px 0 24px; font-size: 14px; }
.foot-row { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.foot-row p { color: var(--ink-2); margin: 4px 0 0; }
.foot-branch { font-style: normal; color: var(--ink-2); margin-top: 8px; }
.foot-branch span { display: block; }
.foot-links { display: flex; gap: 20px; flex-wrap: wrap; }
.foot-links a { color: var(--ink-2); }
.foot-note { color: var(--ink-3); font-size: 12.5px; margin-top: 24px; }
.closed { text-align: center; padding: 120px 20px; }

/* Mini carrito (panel lateral) */
.cart-drawer { position: fixed; inset: 0; z-index: 60; }
.drawer-open, .drawer-open body { overflow: hidden; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .35); }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--bg);
  display: flex; flex-direction: column; box-shadow: -12px 0 32px rgba(0, 0, 0, .14);
  animation: drawer-in .2s ease-out;
}
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .drawer-panel { animation: none; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 18px; }
.drawer-close { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; color: var(--ink); }
.drawer-close:hover { background: var(--soft); }
.drawer-lines { list-style: none; margin: 0; padding: 0 20px; overflow-y: auto; flex: 1; }
.drawer-line { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.drawer-line .line-img { width: 64px; height: 64px; }
.drawer-line.has-problem .line-img { opacity: .6; }
.drawer-line s { color: var(--ink-3); }
.line-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-variant-numeric: tabular-nums; }
.line-side form { margin: 0; }
.link.small { font-size: 13px; color: var(--ink-2); }
.saving { color: var(--sale); font-size: 13px; font-weight: 600; }
.drawer-foot { padding: 16px 20px 20px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.drawer-row { display: flex; justify-content: space-between; margin: 0; font-variant-numeric: tabular-nums; }
.drawer-foot .fine { margin: 0; }
.drawer-empty { padding: 40px 20px; text-align: center; color: var(--ink-2); }

/* Cupón */
.coupon { display: flex; flex-direction: column; gap: 6px; }
.coupon label { font-weight: 600; font-size: 14px; }
.coupon-row { display: flex; gap: 8px; }
.coupon-row input { flex: 1; min-width: 0; height: 44px; border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 16px; font: inherit; text-transform: uppercase; background: var(--bg); }
.coupon-row input:focus { border-color: var(--ink); outline: 2px solid var(--focus); outline-offset: 2px; }
.coupon-applied { display: flex; justify-content: space-between; align-items: center; margin: 0; padding: 10px 14px; border-radius: var(--radius); background: #e8f5ee; color: var(--ok); }

/* Pago en línea (#9) */
.pay-page .box { max-width: 520px; }
.pay-page .banner-info, .pay-page .banner-error { margin: 0 0 16px; }
.pay-amount { font-size: 28px; font-weight: 650; margin: 0 0 8px; }
.pay-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.pay-actions .btn { flex: 1 1 160px; }

/* Modificadores (#54) */
.mods legend small { font-weight: 400; font-size: 13px; margin-left: 6px; }
.mod-list { display: grid; gap: 6px; }
.mod { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; min-height: 44px; }
.mod:has(input:checked) { border-color: var(--ink); }
.mod input { margin: 0; width: 18px; height: 18px; accent-color: var(--ink); }
/* El `input:focus` de los campos de texto también alcanza a radios y casillas: aquí se usa el anillo global (#150). */
.mod input:focus { box-shadow: none; }
.mod input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
fieldset.mods[aria-invalid=true]:focus { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 4px; }
.mod-price { margin-left: auto; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.line-mods { margin: 2px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--ink-2); }
.mini-lines li.child { padding-left: 28px; font-size: 14px; color: var(--ink-2); }
.closed-strip { background: var(--error-bg); color: var(--sale); text-align: center; padding: 10px 16px; font-size: 14px; font-weight: 550; }

/* Plantilla de restaurante (#79) */
.resto-info { background: var(--soft); border-bottom: 1px solid var(--line); }
.resto-info-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-top: 10px; padding-bottom: 10px; font-size: 14px; }
.resto-status { font-weight: 650; display: inline-flex; align-items: center; gap: 8px; }
.resto-status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.resto-status.is-open { color: var(--ok); }
.resto-status.is-closed { color: var(--sale); }
.resto-types { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 0; color: var(--ink-2); }
.resto-types li + li::before { content: "\00b7"; margin: 0 8px; }
.resto-address { color: var(--ink-2); }
.resto-hero { padding: 8px 0 20px; }
.resto-hero h1 { font-size: clamp(28px, 4.5vw, 40px); max-width: 28ch; margin-bottom: 0; }
/* Una sola navegación del menú: en la portada las pestañas sustituyen a la fila de categorías. `store.js` fija --head-h y --resto-nav-h con el alto real. */
.theme-restaurant { --control-line: #8c8c86; }
.theme-restaurant:has(.resto-nav) .cat-nav { display: none; }
.resto-nav { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 10px 0; margin-bottom: 24px; position: sticky; top: var(--head-h, 69px); background: var(--bg); z-index: 20; border-bottom: 1px solid var(--line); }
.resto-nav::-webkit-scrollbar { display: none; }
.resto-nav a { white-space: nowrap; text-decoration: none; font-weight: 600; border: 1px solid var(--control-line); border-bottom-width: 3px; border-radius: 999px; padding: 8px 16px; min-height: 40px; display: inline-flex; align-items: center; }
.resto-nav a:hover { border-color: var(--brand); }
.resto-nav a[aria-current] { border-color: var(--accent); }
.resto-section { scroll-margin-top: calc(var(--head-h, 69px) + var(--resto-nav-h, 62px) + 16px); margin-bottom: 36px; }
.resto-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 0 32px; }
.resto-item { border-bottom: 1px solid var(--line); }
.resto-link { flex-direction: row; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 14px 0; }
.resto-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.resto-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.resto-head .card-price { flex: none; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.resto-desc { color: var(--ink-2); font-size: 14px; }
.resto-img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; flex: none; }
.resto-out { color: var(--sale); font-weight: 600; }
/* Bordes de controles a 3:1 o más contra el fondo (WCAG 1.4.11). */
.theme-restaurant :is(select, input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input:not([type]), textarea, .site-search input), .theme-restaurant .btn:not(.btn-dark), .theme-restaurant .mod, .theme-restaurant .pill span { border-color: var(--control-line); }
.theme-restaurant .btn:not(.btn-dark):hover { border-color: var(--ink); }
@media (max-width: 760px) { .resto-list { grid-template-columns: 1fr; } }

/* Enlaces del aviso al agregar al carrito (#34) */
.flash-links { display: inline-flex; gap: 12px; margin-left: 8px; font-weight: 600; }
.flash-links a { color: inherit; text-decoration: underline; }

/* App «Botón de WhatsApp»: fijo, 48 px como mínimo, verde oscuro con texto blanco (contraste 6:1). */
.wa-btn { position: fixed; bottom: 16px; z-index: 50; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 48px; min-height: 48px; padding: 0 18px; border-radius: 999px; background: #0b6e3c; color: #fff; font-weight: 600; font-size: 15px; text-decoration: none; box-shadow: 0 4px 14px rgba(0, 0, 0, .28); }
.wa-btn:hover { background: #09592f; }
.wa-btn:focus-visible { outline: 3px solid #fff; outline-offset: 0; box-shadow: 0 0 0 6px #0b6e3c; }
.wa-right { right: 16px; }
.wa-left { left: 16px; }
@media (max-width: 480px) { .wa-btn span { display: none; } .wa-btn { padding: 0; width: 52px; height: 52px; } }

/* App «Búsqueda inteligente»: lista de sugerencias bajo el cuadro de búsqueda. */
.suggest-host { position: relative; }
.suggest-list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 45; margin: 0; padding: 6px; list-style: none; background: var(--bg, #fff); color: var(--ink, #111); border: 1px solid var(--line, #ddd); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .14); text-align: left; }
.suggest-list[hidden] { display: none; }
.suggest-list a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 8px; border-radius: 8px; color: inherit; text-decoration: none; }
.suggest-list a:hover, .suggest-list a:focus-visible { background: var(--soft, #f3f3f3); outline: 2px solid var(--focus, currentColor); outline-offset: -2px; }
.suggest-list img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; flex: none; }

/* App «Reseñas de productos»: lista y formulario bajo la ficha. */
.reviews { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 24px; max-width: 720px; }
.reviews .stars { color: #8a5a00; letter-spacing: 2px; }
.reviews-summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.review-list { list-style: none; margin: 0 0 24px; padding: 0; }
.review { padding: 14px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.review p { margin: 0 0 6px; }
.review-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.review-form { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.review-form h3 { margin: 0; font-size: 16px; }
.review-form .btn { align-self: flex-start; min-height: 44px; }
.review-ok { color: #0b6e3c; font-weight: 600; margin: 0 0 12px; }
.review-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
