:root {
  color-scheme: light;
  --fondo: #f6f0e7;
  --superficie: #fffcf7;
  --tinta: #2b1e1b;
  --tinta-suave: #6d5b53;
  --borde: #e6dacb;
  --vino: #6b1d2a;
  --vino-oscuro: #4a1119;
  --crema: #f8ead6;
  --dorado: #b4863a;
  --wa: #128c4a;
  --wa-oscuro: #0d7139;
  --apagado: #8f8179;
  --radio: 14px;
  --sombra: 0 1px 2px rgba(60, 30, 20, .06), 0 4px 14px rgba(60, 30, 20, .07);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

/* "hidden" siempre gana (si no, reglas como .btn { display: inline-flex } lo anulan) */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--fondo);
  color: var(--tinta);
  font: 400 16px/1.5 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; }

.solo-lector {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------------------------------------------------------------- cabecera */

.cabecera {
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(180, 134, 58, .22), transparent 55%),
    linear-gradient(160deg, var(--vino) 0%, var(--vino-oscuro) 100%);
  color: var(--crema);
}

.cabecera-dentro {
  max-width: 1180px;
  margin: 0 auto;
  /* En la app instalada del iPhone, deja libre la zona de la hora y la batería */
  padding: calc(10px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
}
@media (min-width: 760px) { .cabecera-dentro { padding-top: calc(14px + env(safe-area-inset-top)); padding-bottom: 14px; } }

.marca {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
}

.marca-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--crema);
  border: 1.5px solid rgba(248, 234, 214, .55);
  flex: none;
}
@media (min-width: 760px) { .marca-logo { width: 52px; height: 52px; } }

.marca-texto { display: flex; flex-direction: column; min-width: 0; }

.marca-nombre {
  font-family: var(--serif);
  font-weight: 650;
  font-size: clamp(1.2rem, 4.6vw, 1.7rem);
  line-height: 1.15;
  letter-spacing: -.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.marca-eslogan {
  margin-top: 1px;
  font-size: .82rem;
  color: rgba(248, 234, 214, .8);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.marca-eslogan:empty { display: none; }

/* Aviso del panel (la "oferta del día"): dorado vivo, negrita, destellos y un brillo que la recorre. */
.aviso {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 8px 14px;
  background: linear-gradient(100deg, #c8902f 0%, #f1cd73 50%, #c8902f 100%);
  color: #3d0d14;
  text-align: center;
  font-weight: 700;
  font-size: .86rem;
  line-height: 1.3;
  letter-spacing: .05em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(74, 17, 25, .25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
}
.aviso-texto { min-width: 0; overflow-wrap: anywhere; }
.aviso-destello {
  flex: none;
  width: 17px;
  height: 17px;
  fill: var(--vino);
  animation: destello 2.4s ease-in-out infinite;
}
.aviso-destello:last-child { animation-delay: 1.2s; }
@keyframes destello {
  0%, 100% { transform: scale(.8) rotate(0deg); opacity: .65; }
  50% { transform: scale(1.15) rotate(45deg); opacity: 1; }
}
/* brillo diagonal que cruza la franja cada 4 s */
.aviso::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 -40%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
  animation: brillo-aviso 4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes brillo-aviso {
  0%, 55% { transform: translateX(0); }
  100% { transform: translateX(360%); }
}
@media (prefers-reduced-motion: reduce) {
  .aviso::after, .aviso-destello { animation: none; }
  .aviso::after { display: none; }
}

/* ---------------------------------------------------------------- barra de búsqueda y categorías */

/* Encabezado + aviso + buscador/categorías: quedan fijos arriba al hacer scroll.
   En la app del iPhone el encabezado ya cubre la zona de la hora (tiene ese relleno arriba). */
.fijo {
  position: sticky;
  top: 0;
  z-index: 15;
  box-shadow: 0 4px 14px rgba(60, 30, 20, .08);
}

.barra {
  background: rgba(246, 240, 231, .96);
  backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--borde);
}

.barra-dentro {
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.buscador {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: 999px;
  padding: 0 12px;
  height: 42px;
  transition: border-color .15s, box-shadow .15s;
}

.buscador:focus-within {
  border-color: var(--vino);
  box-shadow: 0 0 0 3px rgba(107, 29, 42, .14);
}

.buscador svg {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: var(--tinta-suave); stroke-width: 2; stroke-linecap: round;
}

.buscador input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  height: 100%;
}

/* Botón "Categorías" (abre el panel lateral) */
.filtro-cat {
  flex: none;
  max-width: 45%;
  height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 13px 0 11px;
  border: 1px solid var(--borde);
  border-radius: 999px;
  background: var(--superficie);
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.filtro-cat:hover { border-color: var(--vino); }
.filtro-cat:focus-visible { outline: none; border-color: var(--vino); box-shadow: 0 0 0 3px rgba(107, 29, 42, .14); }
.filtro-cat.activo { background: var(--vino); border-color: var(--vino); color: var(--crema); }
.filtro-cat svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.filtro-cat-texto { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 359px) { .filtro-cat-icono { display: none; } }

/* ---------------------------------------------------------------- panel lateral de categorías */

.lateral {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  padding: 0;
  border: 0;
  width: min(340px, 86vw);
  max-width: none;
  height: 100%;
  max-height: none;
  background: var(--superficie);
  color: var(--tinta);
  box-shadow: -16px 0 48px rgba(40, 12, 14, .28);
}
.lateral::backdrop {
  background: rgba(30, 14, 12, .5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.lateral[open] { animation: lateral-entra .28s cubic-bezier(.2, .8, .2, 1); }
.lateral[open]::backdrop { animation: fondo-entra .28s ease-out; }
.lateral.cerrando { animation: lateral-sale .2s ease-in forwards; }
.lateral.cerrando::backdrop { animation: fondo-sale .2s ease-in forwards; }
@keyframes lateral-entra { from { transform: translateX(100%); } }
@keyframes lateral-sale { to { transform: translateX(100%); } }
@keyframes fondo-entra { from { opacity: 0; } }
@keyframes fondo-sale { to { opacity: 0; } }

.lateral-caja { display: flex; flex-direction: column; height: 100%; }

.lateral-cabecera {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: calc(22px + env(safe-area-inset-top)) 18px 18px 22px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(180, 134, 58, .25), transparent 60%),
    linear-gradient(160deg, var(--vino) 0%, var(--vino-oscuro) 100%);
  color: var(--crema);
}
.lateral-sub {
  margin: 0;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dorado);
}
.lateral-titulo { margin: 2px 0 0; font-family: var(--serif); font-weight: 650; font-size: 1.7rem; line-height: 1.1; }
.lateral-cerrar {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid rgba(248, 234, 214, .3);
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: var(--crema);
  cursor: pointer;
  transition: background .15s;
}
.lateral-cerrar:hover { background: rgba(255, 255, 255, .18); }
.lateral-cerrar svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }

.lateral-lista {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 12px calc(16px + env(safe-area-inset-bottom));
  display: grid;
  align-content: start;
  gap: 4px;
}

.cat-opcion {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 12px 8px 8px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.cat-opcion:hover { background: #f6eee4; }
.cat-opcion:focus-visible { outline: none; border-color: var(--vino); }
.cat-opcion.activa { background: #f3e5e2; border-color: rgba(107, 29, 42, .25); }

.cat-mini {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--crema);
  border: 1px solid var(--borde);
  font-family: var(--serif);
  font-weight: 650;
  font-size: 1.3rem;
  color: rgba(107, 29, 42, .55);
}
.cat-mini img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.cat-mini-todo {
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 9px;
  background: var(--vino);
  border-color: var(--vino);
}
.cat-mini-todo span { border-radius: 3px; background: rgba(248, 234, 214, .85); width: 100%; height: 100%; }
.cat-mini-todo span:nth-child(2) { background: var(--dorado); }

.cat-info { display: grid; min-width: 0; }
.cat-nombre { font-weight: 600; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-cuenta { font-size: .82rem; color: var(--tinta-suave); }
.cat-marca { font-size: 1.3rem; line-height: 1; color: #c2b2a6; }
.cat-opcion.activa .cat-marca { color: var(--vino); font-size: 1.1rem; font-weight: 700; }
.cat-opcion.activa .cat-nombre { color: var(--vino); }

/* ---------------------------------------------------------------- contenido */

.contenido {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 2px 16px 110px;
  outline: none;
}

.seccion { margin-top: 16px; scroll-margin-top: 140px; }

.seccion-titulo {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 8px;
  font-family: var(--serif);
  font-weight: 650;
  font-size: 1.45rem;
  line-height: 1.2;
}
.seccion-titulo::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--borde);
  transform: translateY(-4px);
}
.seccion-cuenta {
  font-family: var(--sans);
  font-size: .85rem;
  font-weight: 500;
  color: var(--tinta-suave);
}

/* ---------------------------------------------------------------- lista de productos (filas) */

.lista {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 3px;
}

.fila {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: 12px;
  padding: 6px 10px 6px 6px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.fila:hover { border-color: #d6c4b0; box-shadow: var(--sombra); }
.fila:focus-visible { outline: 3px solid var(--vino); outline-offset: 2px; }
@media (min-width: 640px) { .fila { grid-template-columns: 72px minmax(0, 1fr) auto; gap: 14px; padding: 6px 14px 6px 6px; } }

.fila-foto {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
@media (min-width: 640px) { .fila-foto { width: 72px; height: 72px; } }
.fila-foto img { width: 100%; height: 100%; object-fit: contain; }
.fila-foto .sin-foto { font-size: 1.7rem; }

.fila-info { min-width: 0; }

.fila-nombre {
  margin: 0;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (min-width: 640px) { .fila-nombre { font-size: 1.08rem; } }

.fila-detalle {
  margin: 1px 0 0;
  color: var(--tinta-suave);
  font-size: .92rem;
}

.fila-precio {
  font-weight: 600;
  color: var(--vino);
}
.fila-precio small { font-weight: 500; font-size: .85em; color: var(--tinta-suave); }
.fila-precio.consultar { color: var(--tinta-suave); font-weight: 500; }

.etiqueta-agotado {
  display: inline-block;
  margin-top: 5px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #fdeceb;
  border: 1px solid #f2c4bf;
  color: #b42318;
  font-size: .78rem;
  font-weight: 600;
}

.fila.agotado .fila-foto,
.fila.agotado .fila-nombre { opacity: .55; }

.fila.en-pedido { border-color: rgba(107, 29, 42, .45); box-shadow: inset 3px 0 0 var(--vino); }

.fila-control:empty { display: none; }

.fila-en-pedido {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--vino);
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* selector − cantidad + */
.cantidad {
  display: inline-flex;
  align-items: center;
  border-radius: 10px;
  background: var(--vino);
  color: #fff;
  overflow: hidden;
  cursor: default;
}
.cantidad button {
  width: 36px;
  height: 40px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}
.cantidad button:hover:not(:disabled) { background: rgba(255, 255, 255, .14); }
.cantidad button:disabled { opacity: .4; cursor: default; }
.cantidad-numero { min-width: 26px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

.cantidad-grande { background: transparent; color: var(--tinta); border: 1px solid var(--borde); border-radius: 12px; }
.cantidad-grande button { width: 46px; height: 48px; }
.cantidad-grande button:hover:not(:disabled) { background: #f3ebe1; }
.cantidad-grande .cantidad-numero { min-width: 34px; font-size: 1.1rem; }

.sin-foto {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-weight: 650;
  font-size: 3rem;
  color: rgba(107, 29, 42, .38);
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, rgba(107, 29, 42, .035) 14px 28px),
    var(--crema);
}

/* ---------------------------------------------------------------- vacío */

.vacio {
  text-align: center;
  padding: 60px 16px;
  color: var(--tinta-suave);
}
.vacio strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--tinta);
  margin-bottom: 6px;
}

/* ---------------------------------------------------------------- botones */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: var(--wa-oscuro); }
.btn-borde { background: transparent; border-color: var(--borde); }
.btn-borde:hover { border-color: var(--vino); }
.btn-vino { background: var(--vino); color: #fff; }
.btn-vino:hover { background: var(--vino-oscuro); }
.btn-texto {
  border: 0;
  background: transparent;
  color: var(--tinta-suave);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 8px;
}
.btn-texto:hover { color: #b42318; }

/* ---------------------------------------------------------------- ficha (detalle) */

.ficha {
  padding: 0;
  border: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100dvh;
  width: 100%;
  margin: auto 0 0;
  color: var(--tinta);
}
.ficha::backdrop { background: rgba(30, 14, 12, .55); }

.ficha-caja {
  position: relative;
  background: var(--superficie);
  border-radius: 20px 20px 0 0;
  max-height: 92dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.ficha[open] .ficha-caja { animation: subir .24s ease-out; }
@keyframes subir { from { transform: translateY(30px); opacity: .4; } }

.ficha-cerrar {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 252, 247, .92);
  box-shadow: var(--sombra);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.ficha-cerrar svg { width: 20px; height: 20px; stroke: var(--tinta); stroke-width: 2.2; stroke-linecap: round; fill: none; }

.ficha-foto { aspect-ratio: 4 / 3; background: #fff; }
.ficha-foto img { width: 100%; height: 100%; object-fit: contain; }
.ficha-foto .sin-foto { font-size: 5rem; }

.ficha-info { padding: 18px 20px calc(24px + env(safe-area-inset-bottom)); }

.ficha-categoria {
  margin: 0;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dorado);
}

.ficha-nombre {
  margin: 4px 0 6px;
  font-family: var(--serif);
  font-weight: 650;
  font-size: 1.7rem;
  line-height: 1.15;
}

.ficha-precio {
  display: block;
  margin: 0;
  font-family: var(--serif);
  font-weight: 650;
  font-size: 1.45rem;
  color: var(--vino);
}
.ficha-precio small { font-family: var(--sans); font-size: .95rem; font-weight: 500; color: var(--tinta-suave); }

.ficha-agotado {
  display: inline-block;
  margin: 10px 0 0;
  padding: 4px 12px;
  border-radius: 999px;
  background: #efe6dc;
  color: var(--tinta-suave);
  font-weight: 600;
  font-size: .88rem;
}

.ficha-descripcion {
  margin: 14px 0 0;
  white-space: pre-line;
  color: #4a3a34;
}
.ficha-descripcion:empty { display: none; }

.ficha-agregar {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}
.ficha-agregar .btn-vino { flex: 1; padding: 0 14px; }

.ficha-acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.ficha-acciones:not(:has(:not([hidden]))) { display: none; }
.ficha-acciones .btn-wa { flex: 1 1 220px; }

/* compartir: botón redondo sobre la foto, a la izquierda (la X va a la derecha) */
.ficha-compartir {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 252, 247, .92);
  box-shadow: var(--sombra);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.ficha-compartir svg { width: 19px; height: 19px; stroke: var(--tinta); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; fill: none; }

/* pedir por peso: Gramos / Dinero, campo libre, conversión y botón */
/* minmax(0, 1fr): la columna nunca crece más que la pantalla por el ancho propio del campo */
.ficha-peso { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 22px; }

.modo-peso {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--borde);
  border-radius: 12px;
  background: #f3ebe1;
}
.modo-peso button {
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--tinta-suave);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.modo-peso button[aria-pressed="true"] { background: var(--vino); color: #fff; box-shadow: 0 1px 3px rgba(74, 17, 25, .25); }
.modo-peso button:focus-visible { outline: 3px solid rgba(107, 29, 42, .35); outline-offset: 1px; }

.campo-peso {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 0 16px;
  border: 1px solid var(--borde);
  border-radius: 12px;
  background: #fff;
  cursor: text;
}
.campo-peso:focus-within { border-color: var(--vino); box-shadow: 0 0 0 3px rgba(107, 29, 42, .14); }
.campo-peso input {
  flex: 1 1 auto;
  width: 0; /* sin esto el campo pide ~20 caracteres de ancho y saca la ficha de la pantalla */
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 1.35rem; /* más de 16px: el iPhone no hace zoom */
  font-weight: 600;
  color: var(--tinta);
  font-variant-numeric: tabular-nums;
}
.campo-peso input::placeholder { color: #b8aaa0; font-weight: 500; }
.campo-peso-prefijo, .campo-peso-sufijo { font-size: 1.1rem; font-weight: 600; color: var(--tinta-suave); }

.peso-conversion { margin: 0; min-height: 1.5em; color: var(--tinta-suave); font-weight: 500; }
.peso-conversion.error { color: #b42318; }
.ficha-peso .btn-vino:disabled { opacity: .5; cursor: default; }
.peso-nota { margin: 0; font-size: .82rem; color: var(--tinta-suave); text-align: center; }

/* ---------------------------------------------------------------- barra inferior del pedido */

.barra-pedido {
  position: fixed;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 20;
  transform: translateX(-50%);
  width: min(560px, calc(100% - 24px));
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 18px 0 14px;
  border: 0;
  border-radius: 16px;
  background: var(--vino);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  box-shadow: 0 10px 28px rgba(74, 17, 25, .38);
  cursor: pointer;
  animation: aparecer-barra .22s ease-out;
}
.barra-pedido:hover { background: var(--vino-oscuro); }
@keyframes aparecer-barra { from { transform: translate(-50%, 20px); opacity: 0; } }

.barra-pedido-icono { position: relative; display: grid; place-items: center; width: 34px; height: 34px; }
.barra-pedido-icono svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.barra-pedido-icono circle { fill: currentColor; stroke: none; }
.barra-pedido-cuenta {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--dorado);
  color: #23170a;
  font-size: .75rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.barra-pedido-texto { flex: 1; text-align: left; }
.barra-pedido-total { font-family: var(--serif); font-size: 1.15rem; }

body.con-pedido .contenido { padding-bottom: 130px; }

/* ---------------------------------------------------------------- carrito */

.pedido-caja { display: block; padding: 0 0 calc(18px + env(safe-area-inset-bottom)); }
@media (min-width: 760px) {
  .pedido { width: min(560px, calc(100vw - 48px)); }
  .pedido-caja { display: block; max-height: min(760px, 92vh); }
}

.pedido-cabecera {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  background: var(--superficie);
  border-bottom: 1px solid var(--borde);
}
.pedido-cabecera h2 { margin: 0; font-family: var(--serif); font-weight: 650; font-size: 1.45rem; }
.pedido-cabecera .ficha-cerrar { position: static; box-shadow: none; background: #f3ebe1; }

.pedido-lista { list-style: none; margin: 0; padding: 6px 20px; }
.pedido-vacio { padding: 28px 0; text-align: center; color: var(--tinta-suave); }
.pedido-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--borde);
}
.pedido-item .fila-foto { width: 56px; height: 56px; }
.pedido-item-info p { margin: 0; }
.pedido-item-nombre { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.pedido-item-detalle { font-size: .85rem; color: var(--tinta-suave); }
.pedido-item-subtotal { font-weight: 600; color: var(--vino); font-size: .95rem; }

.pedido-peso-acciones { display: grid; justify-items: center; gap: 2px; }
.btn-mini {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--borde);
  border-radius: 10px;
  background: transparent;
  color: var(--tinta);
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-mini:hover { border-color: var(--vino); }
.btn-quitar { padding: 4px 8px; font-size: .82rem; }

.pedido-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 20px 4px;
  font-size: 1.05rem;
  font-weight: 600;
}
.pedido-total strong { font-family: var(--serif); font-size: 1.5rem; color: var(--vino); }
.pedido-nota-precio { margin: 0 20px; font-size: .85rem; color: var(--tinta-suave); }

.pedido-datos { padding: 10px 20px 0; display: grid; gap: 10px; }
.pedido-campo { display: grid; gap: 4px; font-size: .9rem; font-weight: 600; }
.pedido-campo em { font-style: normal; font-weight: 400; color: var(--tinta-suave); }
.pedido-campo input, .pedido-campo textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--borde);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-weight: 400;
  font-size: 16px; /* evita el zoom del iPhone */
  color: var(--tinta);
  resize: vertical;
}
.pedido-campo input:focus, .pedido-campo textarea:focus { outline: none; border-color: var(--vino); box-shadow: 0 0 0 3px rgba(107, 29, 42, .14); }

.pedido-acciones { display: grid; gap: 8px; padding: 16px 20px 0; }
.pedido-acciones .btn-texto { justify-self: center; }

@media (min-width: 760px) {
  .ficha { width: min(860px, calc(100vw - 48px)); margin: auto; }
  .ficha-caja {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-radius: 20px;
    max-height: min(640px, 90vh);
  }
  .ficha-foto { aspect-ratio: auto; min-height: 100%; }
  .ficha-info { padding: 30px 28px; align-self: center; }
  .ficha[open] .ficha-caja { animation-name: aparecer; }
  @keyframes aparecer { from { transform: scale(.97); opacity: .4; } }
}

/* ---------------------------------------------------------------- pie */

.pie {
  background: var(--vino-oscuro);
  color: rgba(248, 234, 214, .86);
  font-size: .93rem;
}
.pie-dentro {
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px 16px 100px;
  display: grid;
  gap: 18px;
}
@media (min-width: 760px) { .pie-dentro { grid-template-columns: repeat(3, 1fr); padding-bottom: 40px; } }

.pie-nombre { font-family: var(--serif); font-weight: 650; font-size: 1.2rem; color: var(--crema); margin: 0 0 4px; }
.pie-titulo { margin: 0 0 4px; font-weight: 600; color: var(--crema); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.pie p { margin: 0; }
.pie a { color: var(--crema); text-underline-offset: 3px; }
.pie-enlaces { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.pie-legal { grid-column: 1 / -1; font-size: .8rem; color: rgba(248, 234, 214, .55); }

/* ---------------------------------------------------------------- WhatsApp flotante */

.wa-flotante {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 54px;
  padding: 0 20px 0 16px;
  border-radius: 999px;
  background: var(--wa);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(18, 140, 74, .35);
  transition: background .15s, transform .15s;
}
.wa-flotante:hover { background: var(--wa-oscuro); transform: translateY(-1px); }
.wa-flotante svg { width: 26px; height: 26px; fill: currentColor; }

/* ---------------------------------------------------------------- aviso flotante */

.aviso-flotante {
  position: fixed;
  left: 50%;
  bottom: 90px;
  z-index: 30;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  background: var(--tinta);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: .92rem;
  transition: opacity .2s, transform .2s;
}
.aviso-flotante.visible { opacity: 1; transform: translate(-50%, 0); }
.aviso-flotante.con-accion {
  display: flex;
  align-items: center;
  gap: 14px;
  width: max-content;
  max-width: calc(100vw - 32px);
  border-radius: 14px;
  padding: 10px 10px 10px 18px;
}
.aviso-flotante.con-accion.visible { pointer-events: auto; }
.aviso-accion {
  flex: none;
  border: 0;
  border-radius: 9px;
  padding: 7px 12px;
  background: var(--dorado);
  color: #23170a;
  font-weight: 700;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
