/* ==========================================================================
   CAVA24 — prototipo navegable
   Implementación del "CAVA24 Design System v1.0" y del Manual de marca 2.0
   (prototipo/Branding Cava24 marketplace). Único lugar donde viven color,
   tipografía y componentes: un color o una fuente se cambian acá y en ningún
   otro archivo.
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Petrona:ital,wght@0,400;0,500;0,600;1,400&family=Hanken+Grotesk:wght@400;500;600;700&family=Jost:wght@300&display=swap");

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Marca */
  --primary: #ff671d; /* Naranja CAVA · Pantone 165 C — acción, foco */
  --primary-hover: #e05512;
  --primary-soft: #fff0e8; /* fondos de acento */
  --primary-ink: #b4430d; /* naranja para texto chico sobre claro (AA) */
  --on-primary: #ffffff; /* texto sobre el naranja — ver nota de contraste */

  /* Neutros cálidos */
  --ink: #231f20; /* Negro Cava — titulares */
  --ink-2: #3a3435; /* superficies activas sobre negro */
  --text: #4a453f; /* cuerpo */
  --muted: #69635c; /* Warm Gray 11 — texto secundario */
  --disabled: #8a837b; /* gris medio — deshabilitado, tachados */
  --on-dark-muted: #b4ada4; /* texto secundario sobre negro */
  --border: #dfd8cf;
  --sunken: #efe9e1; /* Hueso 2 — filas alternas, fondo de foto */
  --page: #f7f3ee; /* Hueso — fondo de página */
  --card: #ffffff;

  /* Estado */
  --success: #2e7d4f;
  --success-soft: #e6f2ea;
  --success-ink: #1f5e39;
  --warning: #b8860b;
  --warning-soft: #f7efd9;
  --warning-ink: #8a6208;
  --error: #b02a0f;
  --error-soft: #f8e7e3;
  --error-ink: #8e2109;
  --info: #3b5b8c;
  --info-soft: #e9eef6;
  --info-ink: #2c4670;

  /* Tipografía: Petrona para lo que se lee, Hanken Grotesk para lo que se
     opera. Jost solo en el "24" del logo. */
  --serif: "Petrona", Georgia, "Times New Roman", serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --logo: "Jost", "Futura", sans-serif;

  /* Escala de 4 px */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s8: 32px;
  --s10: 40px;
  --s12: 48px;
  --s16: 64px;

  /* Esquinas rectas: el radio es 0 salvo en badges y avatares */
  --radius: 0;
  --pill: 999px;

  --focus: 0 0 0 2px var(--page), 0 0 0 4px var(--primary);
  /* Storefront width: four catalogue columns beside the filters from 1360 px */
  --wrap: 1360px;
  /* Back-office width: dense tables need the room a wide screen has */
  --app-wrap: 1440px;
}

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

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

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
}

/* A component's own display must never beat the hidden attribute */
[hidden] {
  display: none !important;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: var(--primary);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

::selection {
  background: var(--primary);
  color: var(--on-primary);
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 0;
}

.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;
}

/* Salto al contenido: primer elemento enfocable de cada pantalla. Fuera de
   pantalla hasta recibir foco, y entonces un control visible. */
.skip-link {
  position: absolute;
  left: var(--s4);
  top: -100px;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: var(--s3) var(--s4);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
}

.skip-link:focus {
  top: var(--s4);
}

/* --------------------------------------------------------------------------
   Tipografía
   -------------------------------------------------------------------------- */
.display,
.h1,
.h2,
.h3 {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ink);
  text-wrap: balance;
}

.display {
  font-size: clamp(32px, 5vw, 44px);
  line-height: 1.09;
  letter-spacing: -0.01em;
}

.h1 {
  font-size: clamp(26px, 3.4vw, 32px);
  line-height: 1.125;
}

.h2 {
  font-size: 22px;
  line-height: 28px;
}

.h3 {
  font-size: 17px;
  line-height: 22px;
}

.italic {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--muted);
}

.lead {
  font-size: 17px;
  line-height: 28px;
  color: var(--text);
}

.body {
  font-size: 15px;
  line-height: 24px;
}

.ui {
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
}

.small {
  font-size: 13px;
  line-height: 20px;
}

.caption {
  font-size: 12px;
  line-height: 18px;
  color: var(--muted);
}

.eyebrow {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 10.5px;
  line-height: 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow-accent {
  color: var(--primary-ink);
}

.on-dark .eyebrow-accent,
.band-dark .eyebrow-accent {
  color: var(--primary);
}

.num,
.tabular {
  font-variant-numeric: tabular-nums;
}

.text-ink {
  color: var(--ink);
}

.text-muted {
  color: var(--muted);
}

.text-success {
  color: var(--success-ink);
}

.text-error {
  color: var(--error-ink);
}

.text-right {
  text-align: right;
}

.strong {
  font-weight: 600;
  color: var(--ink);
}

.prose p + p {
  margin-top: var(--s3);
}

/* Running text never spans a wide screen: past ~75 characters a line is hard
   to follow back. Zero specificity, so any explicit measure class still wins. */
:where(#contenido) :where(p, li) {
  max-width: 75ch;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--s6);
}

.wrap-narrow {
  max-width: 760px;
}

.wrap-form {
  max-width: 880px;
}

/* A flex column rather than margins between children: margins do nothing to
   inline children, so a stack of links or spans used to run together */
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--gap, var(--s4));
}

.stack > .btn,
.stack > .badge,
.stack > .tag,
.stack > .stock,
.stack > .chip {
  align-self: flex-start;
}

.stack > .btn-block {
  align-self: stretch;
}

.stack-sm {
  --gap: var(--s2);
}

.stack-lg {
  --gap: var(--s8);
}

.stack-xl {
  --gap: var(--s12);
}

.row {
  display: flex;
  align-items: center;
  gap: var(--gap, var(--s3));
}

/* A field inside a row gives way before the row pushes past the screen: a
   select is as wide as its longest option unless told it may shrink */
.row > .select,
.row > .input,
.row > .search {
  min-width: 0;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  flex-wrap: wrap;
}

.row-end {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s4);
  flex-wrap: wrap;
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--gap, var(--s2));
}

.grid {
  display: grid;
  gap: var(--gap, var(--s5));
}

.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: var(--gap, var(--s5));
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 720px) {
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.grid-products {
  display: grid;
  gap: var(--s5);
  /* 240 px keeps the winery line and the case price legible; still four
     columns beside the filters from 1360 px */
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

/* Catálogo: panel de filtros + resultados */
.catalog {
  display: grid;
  gap: var(--s6);
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

@media (min-width: 960px) {
  .catalog {
    grid-template-columns: 260px minmax(0, 1fr);
  }
}

/* Contenido + columna lateral (resumen de pedido, acciones de admin) */
.split {
  display: grid;
  gap: var(--s8);
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

@media (min-width: 1024px) {
  .split {
    grid-template-columns: minmax(0, 1fr) 360px;
  }

  .split-wide-aside {
    grid-template-columns: minmax(0, 1fr) 400px;
  }

  .sticky {
    position: sticky;
    top: var(--s6);
  }
}

.section {
  padding-block: var(--s12);
}

@media (min-width: 900px) {
  .section {
    padding-block: var(--s16);
  }
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s6);
  flex-wrap: wrap;
  border-bottom: 1px solid var(--ink);
  padding-bottom: var(--s3);
}

.section-title > * {
  min-width: 0;
  max-width: 100%;
}

.band-soft {
  background: var(--sunken);
}

.band-white {
  background: var(--card);
}

.band-dark {
  background: var(--ink);
  color: var(--on-dark-muted);
}

.band-dark .display,
.band-dark .h1,
.band-dark .h2,
.band-dark .h3 {
  color: var(--page);
}

.divider {
  border-top: 1px solid var(--border);
}

.divider-strong {
  border-top: 1px solid var(--ink);
}

.mt-1 { margin-top: var(--s1); }
.mt-2 { margin-top: var(--s2); }
.mt-3 { margin-top: var(--s3); }
.mt-4 { margin-top: var(--s4); }
.mt-6 { margin-top: var(--s6); }
.mt-8 { margin-top: var(--s8); }
.mt-12 { margin-top: var(--s12); }

.ml-auto {
  margin-left: auto;
}

.max-60 {
  max-width: 60ch;
}

.max-44 {
  max-width: 44ch;
}

/* --------------------------------------------------------------------------
   Logo (lockup principal: isotipo + wordmark CAVA + "24" en Jost Light)
   Construcción del manual: wordmark 0,74 x, separación 0,15 x, el número
   pegado al wordmark sobre la misma línea de base.
   -------------------------------------------------------------------------- */
.logo {
  --x: 24px;
  display: inline-flex;
  align-items: center;
  gap: calc(var(--x) * 0.2);
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.logo img {
  display: block;
}

.logo .logo-iso {
  height: var(--x);
}

.logo .logo-word {
  display: flex;
  align-items: flex-end;
}

.logo .logo-word img {
  height: calc(var(--x) * 0.74);
}

.logo .logo-24 {
  font-family: var(--logo);
  font-weight: 300;
  font-size: calc(var(--x) * 1.04);
  line-height: 0.69;
  color: var(--primary);
}

.logo-lg {
  --x: 44px;
}

.logo-md {
  --x: 32px;
}

/* --------------------------------------------------------------------------
   Botones — un primario por pantalla. 40 px (md), 32 px (sm), 48 px (lg).
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  height: 40px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--card);
  color: var(--ink);
  border-color: var(--ink);
}

.btn-secondary:hover {
  background: var(--ink);
  color: #fff;
}

.btn-dark {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.btn-dark:hover {
  background: var(--ink-2);
}

.btn-tertiary {
  background: transparent;
  color: var(--ink);
  padding: 0 var(--s2);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--border);
}

.btn-tertiary:hover {
  text-decoration-color: var(--primary);
}

.btn-danger {
  background: transparent;
  color: var(--error);
  padding: 0 var(--s2);
}

.btn-danger-solid {
  background: var(--error);
  color: #fff;
}

.btn-danger-solid:hover {
  background: var(--error-ink);
}

.btn[disabled],
.btn.is-disabled {
  background: var(--border);
  color: var(--disabled);
  border-color: var(--border);
  cursor: not-allowed;
}

.btn-secondary[disabled] {
  background: var(--card);
}

.btn-sm {
  height: 32px;
  padding: 0 14px;
  font-size: 12px;
}

.btn-lg {
  height: 48px;
  padding: 0 24px;
  font-size: 14px;
}

.btn-block {
  width: 100%;
}

/* On a phone a long label wraps instead of pushing the page sideways */
@media (max-width: 560px) {
  .btn:not(.btn-icon) {
    max-width: 100%;
    white-space: normal;
    height: auto;
    min-height: 40px;
    padding-block: 10px;
    line-height: 1.25;
    text-align: center;
  }

  .btn-sm:not(.btn-icon) {
    min-height: 32px;
    padding-block: 6px;
  }
}

.btn-icon {
  width: 40px;
  padding: 0;
  flex-shrink: 0;
  font-size: 18px;
  font-weight: 500;
}

.btn-icon.btn-sm {
  width: 32px;
}

.band-dark .btn-secondary {
  background: transparent;
  color: #fff;
  border-color: #fff;
}

.band-dark .btn-secondary:hover {
  background: #fff;
  color: var(--ink);
}

/* Cantidad en cajas */
.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--ink);
  height: 40px;
  background: var(--card);
}

.stepper button {
  width: 40px;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  cursor: pointer;
}

.stepper button:hover {
  background: var(--sunken);
}

.stepper input,
.stepper output {
  width: 48px;
  border: 0;
  text-align: center;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: transparent;
  -moz-appearance: textfield;
}

.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stepper-sm {
  height: 32px;
}

.stepper-sm button {
  width: 32px;
}

.stepper-sm input,
.stepper-sm output {
  width: 40px;
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   Formularios — altura 40 px, etiqueta siempre visible sobre el campo.
   -------------------------------------------------------------------------- */
.form-grid {
  display: grid;
  gap: var(--s5) var(--s6);
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 720px) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .span-2 {
    grid-column: span 2;
  }

  .span-all {
    grid-column: 1 / -1;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.label {
  font-weight: 500;
  font-size: 12.5px;
  line-height: 16px;
  color: var(--ink);
}

.label .req {
  color: var(--primary-ink);
}

.label .opt {
  font-weight: 400;
  color: var(--muted);
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s3);
}

.input,
.select,
.textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 20px;
  outline: none;
}

.textarea {
  height: auto;
  min-height: 112px;
  padding: 10px 12px;
  resize: vertical;
}

.select {
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2369635C' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--disabled);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-soft);
}

.input[disabled],
.select[disabled],
.input[readonly].is-locked {
  background: var(--sunken);
  color: var(--disabled);
}

.field.is-invalid .input,
.field.is-invalid .select,
.field.is-invalid .textarea,
.field.is-invalid .file-drop {
  border-color: var(--error);
}

.help {
  font-size: 12px;
  line-height: 18px;
  color: var(--muted);
}

.field-error {
  font-size: 12px;
  line-height: 18px;
  color: var(--error);
}

.field.is-valid .help-ok {
  color: var(--success-ink);
}

/* Prefijo / sufijo ($, cajas, %) */
.input-group {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  background: var(--card);
  height: 40px;
}

.input-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-soft);
}

.input-group .input {
  border: 0;
  height: 38px;
  box-shadow: none;
}

.input-group .affix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: var(--muted);
  font-size: 13px;
  background: var(--sunken);
  white-space: nowrap;
}

/* Búsqueda */
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  background: var(--card);
}

.search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-soft);
}

/* The field fills the whole box, so touching anywhere in it focuses search */
.search input {
  flex: 1;
  align-self: stretch;
  height: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
}

.search input::placeholder {
  color: var(--disabled);
}

.search svg {
  flex-shrink: 0;
}

/* Checkbox, radio y switch — cuadrados, el radio circular */
.check,
.radio {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}

.check input,
.radio input {
  appearance: none;
  margin: 0;
  width: 16px;
  height: 16px;
  border: 1px solid var(--muted);
  background: var(--card);
  flex-shrink: 0;
  display: grid;
  place-content: center;
  cursor: pointer;
}

.radio input {
  border-radius: 50%;
}

.check input:checked {
  background: var(--primary);
  border-color: var(--primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='8' viewBox='0 0 10 8'%3E%3Cpath d='M1 4l3 3 5-6' fill='none' stroke='%23fff' stroke-width='1.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.radio input:checked {
  border: 5px solid var(--primary);
}

.check input:focus-visible,
.radio input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.check .count {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}

.switch input {
  appearance: none;
  margin: 0;
  width: 34px;
  height: 20px;
  border-radius: var(--pill);
  background: var(--border);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.switch input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.15s ease;
}

.switch input:checked {
  background: var(--primary);
}

.switch input:checked::after {
  left: 16px;
}

/* Opción seleccionable grande (tipo de negocio, modalidad) */
.choice-grid {
  display: grid;
  gap: var(--s3);
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.choice {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--s4);
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
}

.choice:hover {
  border-color: var(--ink);
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice:has(input:checked) {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
  background: var(--primary-soft);
}

.choice:has(input:focus-visible) {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.choice .choice-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}

.choice .choice-desc {
  font-size: 12.5px;
  line-height: 18px;
  color: var(--muted);
}

/* Adjuntos */
.file-drop {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s4);
  border: 1px dashed var(--muted);
  background: var(--card);
}

.file-drop .file-icon {
  width: 36px;
  height: 44px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--sunken);
  display: grid;
  place-content: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.file-drop.is-attached {
  border-style: solid;
  border-color: var(--border);
}

.file-drop .file-meta {
  flex: 1;
  min-width: 0;
}

.file-drop .file-name {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.fieldset legend {
  padding: 0;
}

.form-section {
  background: var(--card);
  border: 1px solid var(--border);
  padding: var(--s6);
}

.form-section + .form-section {
  margin-top: var(--s5);
}

.form-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s4);
  padding-bottom: var(--s4);
  margin-bottom: var(--s5);
  border-bottom: 1px solid var(--sunken);
}

.form-actions {
  display: flex;
  gap: var(--s3);
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  padding-top: var(--s5);
}

/* --------------------------------------------------------------------------
   Datos de ficha (par label / valor)
   -------------------------------------------------------------------------- */
.spec-grid {
  display: grid;
  gap: var(--s4);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 720px) {
  .spec-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.spec {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.spec dt {
  font-weight: 600;
  font-size: 10.5px;
  line-height: 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.spec {
  min-width: 0;
}

.spec dd {
  font-size: 14px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.spec-list {
  display: flex;
  flex-direction: column;
  font-size: 13.5px;
}

.spec-list > div {
  display: flex;
  justify-content: space-between;
  gap: var(--s3);
  border-top: 1px solid var(--sunken);
  padding: 9px 0;
}

.spec-list > div:last-child {
  border-bottom: 1px solid var(--sunken);
}

.spec-list dt {
  color: var(--muted);
  flex-shrink: 0;
}

/* Emails and references are long single words: let them break, not overflow */
.spec-list dd {
  min-width: 0;
  font-weight: 500;
  color: var(--ink);
  text-align: right;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.spec-list .total {
  border-top: 1px solid var(--ink);
  padding-top: var(--s3);
}

.spec-list .total dt {
  font-weight: 600;
  color: var(--ink);
}

.spec-list .total dd {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 22px;
}

/* --------------------------------------------------------------------------
   Filtros
   -------------------------------------------------------------------------- */
.filters {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--sunken);
  padding-top: 18px;
}

.filter-group:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.filter-group > .eyebrow {
  display: flex;
  justify-content: space-between;
}

/* Una legend se dibuja sobre el borde del fieldset; flotada, vuelve al flujo */
.filter-group > legend {
  float: left;
  width: 100%;
}

.filter-group > legend + * {
  clear: both;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.filter-options .check {
  font-size: 13.5px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 500;
  font-size: 12.5px;
  line-height: 18px;
  text-decoration: none;
  cursor: pointer;
}

.chip:hover {
  border-color: var(--ink);
}

.chip.is-active,
.chip[aria-pressed="true"],
.chip[aria-current="page"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* Chip de filtro aplicado, con cruz para quitar */
.chip-applied {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: 6px 8px 6px 12px;
  background: var(--ink);
  color: #fff;
  font-weight: 500;
  font-size: 12.5px;
  line-height: 18px;
  text-decoration: none;
}

.chip-applied span[aria-hidden] {
  font-size: 14px;
  line-height: 1;
  opacity: 0.7;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--border);
  background: var(--card);
}

.segmented > * {
  padding: 8px 14px;
  font-weight: 500;
  font-size: 12.5px;
  color: var(--text);
  text-decoration: none;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.segmented > * + * {
  border-left: 1px solid var(--border);
}

.segmented > .is-active {
  background: var(--ink);
  color: #fff;
}

/* --------------------------------------------------------------------------
   Precios — siempre sin IVA
   -------------------------------------------------------------------------- */
.price {
  font-weight: 600;
  font-size: 17px;
  line-height: 22px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.price-lg {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 32px;
  line-height: 36px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.price-unit {
  font-size: 11.5px;
  line-height: 16px;
  color: var(--muted);
}

.price-locked {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-size: 12.5px;
  line-height: 18px;
  color: var(--muted);
}

.price-locked svg {
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Badges y estados — fondo suave, texto pleno, punto de color
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 8px;
  border-radius: var(--pill);
  font-weight: 600;
  font-size: 12px;
  line-height: 14px;
  white-space: nowrap;
  background: var(--sunken);
  color: var(--text);
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}

.badge-orange {
  background: var(--primary-soft);
  color: var(--primary-ink);
}

.badge-orange::before {
  background: var(--primary);
}

.badge-warning {
  background: var(--warning-soft);
  color: var(--warning-ink);
}

.badge-warning::before {
  background: var(--warning);
}

.badge-info {
  background: var(--info-soft);
  color: var(--info-ink);
}

.badge-info::before {
  background: var(--info);
}

.badge-success {
  background: var(--success-soft);
  color: var(--success-ink);
}

.badge-success::before {
  background: var(--success);
}

.badge-error {
  background: var(--error-soft);
  color: var(--error-ink);
}

.badge-error::before {
  background: var(--error);
}

/* Contador en navegación */
.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  padding: 2px 7px;
  border-radius: var(--pill);
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 11px;
  line-height: 14px;
  font-variant-numeric: tabular-nums;
}

/* Stock en línea */
.stock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  font-size: 12.5px;
  line-height: 18px;
  color: var(--success-ink);
}

.stock::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
}

.stock-low {
  color: var(--warning-ink);
}

.stock-low::before {
  background: var(--warning);
}

.stock-out {
  color: var(--error-ink);
}

.stock-out::before {
  background: var(--error);
}

/* Etiquetas rectas (varietal, región, tipo) */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
  font-size: 10.5px;
  line-height: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tag-solid {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.tag-ink {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* Avatar — iniciales en Petrona sobre negro */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--page);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  flex-shrink: 0;
}

.avatar-square {
  border-radius: 0;
  font-family: var(--serif);
}

.avatar-lg {
  width: 48px;
  height: 48px;
  font-size: 20px;
}

/* --------------------------------------------------------------------------
   Cards — borde, sin sombra
   -------------------------------------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
}

.card-pad {
  padding: var(--s5);
}

.card-pad-lg {
  padding: var(--s6);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s4);
  padding: var(--s4) 18px;
  border-bottom: 1px solid var(--sunken);
}

.card-body {
  padding: var(--s4) 18px;
}

.card-foot {
  padding: var(--s4) 18px;
  border-top: 1px solid var(--sunken);
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.card-link:hover,
.card-hover:hover {
  border-color: var(--ink);
}

/* Card de producto */
.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.product-card:hover {
  border-color: var(--ink);
}

.product-card .pc-media {
  position: relative;
  display: block;
  background: var(--sunken);
  aspect-ratio: 6 / 5;
  max-width: 100%;
}

.product-card .pc-media .tag {
  position: absolute;
  top: 12px;
  left: 12px;
}

.product-card .pc-body {
  padding: var(--s4);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  flex: 1;
}

.product-card .pc-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 17px;
  line-height: 22px;
  color: var(--ink);
  text-decoration: none;
}

.product-card .pc-title::after {
  /* toda la card es clickeable sin anidar enlaces */
  content: "";
  position: absolute;
  inset: 0;
}

.product-card {
  position: relative;
}

.product-card .pc-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--s3);
  border-top: 1px solid var(--sunken);
  padding-top: var(--s3);
  margin-top: auto;
}

.product-card .pc-foot .btn {
  position: relative;
  z-index: 1;
}

.product-card.is-soldout .pc-media {
  opacity: 0.6;
}

/* Placeholder por tipo de vino, para productos sin foto */
.placeholder {
  width: 100%;
  height: 100%;
  display: block;
}

.thumb {
  width: 40px;
  height: 52px;
  background: var(--sunken);
  flex-shrink: 0;
  display: block;
}

.thumb-lg {
  width: 56px;
  height: 72px;
}

/* Métrica de panel */
.metric {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.metric .metric-value {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 32px;
  line-height: 36px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.metric .metric-note {
  font-size: 12.5px;
  color: var(--muted);
}

.metric-dark {
  background: var(--ink);
  border-color: var(--ink);
}

.metric-dark .eyebrow {
  color: var(--primary);
}

.metric-dark .metric-value {
  color: var(--page);
}

.metric-dark .metric-note {
  color: var(--on-dark-muted);
}

a.metric {
  text-decoration: none;
}

a.metric:hover {
  border-color: var(--ink);
}

/* Card de bodega */
.winery-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--border);
}

/* Resumen de pedido (Mi pedido) */
.summary {
  background: var(--card);
  border: 1px solid var(--border);
}

.summary-line {
  display: flex;
  gap: var(--s3);
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--sunken);
}

.summary-line .sl-name {
  flex: 1;
  min-width: 0;
}

.summary-line .sl-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 14px;
  line-height: 18px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Grupo por bodega (carrito, checkout, detalle de pedido) */
.winery-group {
  background: var(--card);
  border: 1px solid var(--border);
}

.winery-group + .winery-group {
  margin-top: var(--s5);
}

.wg-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s4);
  flex-wrap: wrap;
  padding: var(--s4) 18px;
  border-bottom: 1px solid var(--ink);
}

.wg-head .wg-name {
  display: flex;
  align-items: center;
  gap: var(--s3);
}

.wg-line {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: var(--s3) var(--s4);
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--sunken);
}

@media (min-width: 720px) {
  .wg-line {
    grid-template-columns: 40px minmax(0, 1fr) 150px 110px 120px;
  }

  .wg-line-simple {
    grid-template-columns: 40px minmax(0, 1fr) 110px 130px;
  }
}

.wg-line .wg-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 15px;
  line-height: 20px;
  color: var(--ink);
}

.wg-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s4);
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--page);
}

/* --------------------------------------------------------------------------
   Tabla — filas de 52 px, números tabulares a la derecha
   -------------------------------------------------------------------------- */
/* Positioned so absolutely placed descendants (screen-reader labels) are
   clipped by the scroll area instead of stretching the whole page */
.table-wrap {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  line-height: 18px;
  min-width: 720px;
}

.table th {
  text-align: left;
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 14px;
  border-bottom: 1px solid var(--ink);
  white-space: nowrap;
}

.table td {
  padding: 0 14px;
  height: 52px;
  border-bottom: 1px solid var(--sunken);
  color: var(--ink);
  vertical-align: middle;
}

.table td.pad {
  padding-block: 12px;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover td {
  background: var(--page);
}

.table .num,
.table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table .strong {
  font-weight: 600;
}

.table .muted {
  color: var(--muted);
}

.table a.row-link {
  font-weight: 600;
  text-decoration: none;
}

.table a.row-link:hover {
  text-decoration: underline;
  text-decoration-color: var(--primary);
}

.table tfoot td {
  border-top: 1px solid var(--ink);
  border-bottom: 0;
  font-weight: 600;
}

/* On a wide screen identifiers, amounts and states stay on one line: an order
   number broken in two makes every row taller for nothing. Dates hold together
   through non-breaking spaces instead, and every other cell may wrap, so a
   list of wineries cannot push the row's action out of view. */
@media (min-width: 721px) {
  .table td:first-child:not(.pad),
  .table td.num,
  .table td > .badge {
    white-space: nowrap;
  }
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s3);
  flex-wrap: wrap;
  padding: var(--s3) 14px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.cell-product {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding-block: 8px;
}

.cell-product .thumb {
  width: 32px;
  height: 42px;
}

/* Paginación — sin estado deshabilitado: lo que no existe no se muestra */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s3);
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}

.pagination nav {
  display: flex;
  gap: var(--s1);
}

.pagination a,
.pagination span[aria-current] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}

.pagination span[aria-current] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* --------------------------------------------------------------------------
   Pasos del pedido — los cinco estados lineales, legibles sin leyenda
   -------------------------------------------------------------------------- */
.steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--s1);
  list-style: none;
  padding: 0;
  margin: 0;
}

.steps li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.steps li::before {
  content: "";
  height: 4px;
  background: var(--border);
}

.steps li.is-done::before {
  background: var(--ink);
}

.steps li.is-current::before {
  background: var(--primary);
}

.steps .step-label {
  font-size: 12px;
  line-height: 16px;
  color: var(--muted);
}

.steps li.is-done .step-label {
  color: var(--ink);
}

.steps li.is-current .step-label {
  color: var(--ink);
  font-weight: 600;
}

.steps .step-date {
  font-size: 11px;
  line-height: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 560px) {
  .steps .step-label {
    font-size: 11px;
  }
}

/* --------------------------------------------------------------------------
   Avisos
   -------------------------------------------------------------------------- */
.notice {
  display: flex;
  gap: var(--s3);
  align-items: flex-start;
  padding: 14px var(--s4);
  border: 1px solid var(--border);
  border-left: 3px solid var(--muted);
  background: var(--card);
  font-size: 13.5px;
  line-height: 20px;
  color: var(--text);
}

.notice-title {
  display: block;
  font-weight: 600;
  color: var(--ink);
}

.notice > .ml-auto {
  flex-shrink: 0;
  align-self: center;
}

@media (max-width: 720px) {
  .notice {
    flex-wrap: wrap;
  }

  .notice > .ml-auto {
    margin-left: 0;
  }
}

.notice-accent {
  border-left-color: var(--primary);
  background: var(--primary-soft);
  border-color: #f6d5c3;
  border-left-color: var(--primary);
}

.notice-info {
  border-left-color: var(--info);
  background: var(--info-soft);
  border-color: #cfd9ea;
  border-left-color: var(--info);
}

.notice-warning {
  border-left-color: var(--warning);
  background: var(--warning-soft);
  border-color: #ead9ab;
  border-left-color: var(--warning);
}

.notice-error {
  border-left-color: var(--error);
  background: var(--error-soft);
  border-color: #eec4ba;
  border-left-color: var(--error);
}

.notice-success {
  border-left-color: var(--success);
  background: var(--success-soft);
  border-color: #bcdcc7;
  border-left-color: var(--success);
}

.notice ul {
  margin: var(--s1) 0 0;
  padding-left: 18px;
}

/* Nota interna de Cava24 — nunca la ve el comprador ni la bodega */
.internal {
  border: 1px dashed var(--muted);
  background: repeating-linear-gradient(
    -45deg,
    var(--card),
    var(--card) 10px,
    var(--page) 10px,
    var(--page) 20px
  );
}

.internal-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--ink);
  padding: 3px 8px;
}

.note {
  border-top: 1px solid var(--sunken);
  padding: var(--s3) 0;
}

.note:first-child {
  border-top: 0;
}

.note-meta {
  font-size: 12px;
  color: var(--muted);
}

.note-text {
  font-size: 14px;
  color: var(--ink);
  margin-top: 2px;
}

/* Estado vacío */
.empty {
  background: var(--card);
  border: 1px solid var(--border);
  padding: var(--s12) var(--s6);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s3);
}

/* --------------------------------------------------------------------------
   Navegación
   -------------------------------------------------------------------------- */
/* Header del comprador */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: var(--s6);
  height: 64px;
}

.topnav {
  display: flex;
  gap: var(--s6);
  height: 100%;
  align-items: stretch;
}

.topnav a {
  display: flex;
  align-items: center;
  font-weight: 500;
  font-size: 13.5px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.topnav a:hover {
  color: var(--ink);
}

.topnav a[aria-current="page"] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--primary);
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

/* El buscador queda centrado entre el logo y las acciones */
.topbar .search {
  height: 36px;
  flex: 1 1 260px;
  max-width: 520px;
  margin-inline: auto;
}

.topbar-link {
  font-weight: 500;
  font-size: 13.5px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.topbar-link:hover {
  color: var(--ink);
}

/* Narrow header: logo and actions, then the sections, then search on a row of
   its own — a buyer on a phone must still be able to search the catalogue */
@media (max-width: 960px) {
  .topbar-inner {
    height: auto;
    padding-block: var(--s3);
    flex-wrap: wrap;
    gap: var(--s2) var(--s3);
  }

  .topnav {
    order: 3;
    width: 100%;
    height: auto;
    gap: var(--s5);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .topnav::-webkit-scrollbar {
    display: none;
  }

  .topnav a {
    min-height: 44px;
  }

  /* The actions stop being a box, so search can take a row of its own while
     the order button and the account stay beside the logo */
  .topbar-actions {
    display: contents;
  }

  .topbar-inner > .logo {
    margin-right: auto;
  }

  .topbar .btn {
    white-space: nowrap;
  }

  .topbar .search {
    order: 4;
    width: 100%;
    max-width: none;
    flex-basis: 100%;
    height: 44px;
  }

  .topbar-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* Menú de cuenta */
.account {
  position: relative;
}

.account > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--s2);
}

.account > summary::-webkit-details-marker {
  display: none;
}

.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  min-width: 240px;
  background: var(--card);
  border: 1px solid var(--ink);
  padding: var(--s2) 0;
}

.account-menu a,
.account-menu .account-who {
  display: block;
  padding: var(--s2) var(--s4);
  font-size: 13.5px;
  text-decoration: none;
  color: var(--ink);
}

.account-menu a:hover {
  background: var(--page);
}

.account-menu .account-who {
  border-bottom: 1px solid var(--sunken);
  padding-bottom: var(--s3);
  margin-bottom: var(--s1);
}

/* Barra lateral de bodega y backoffice */
.app {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

.side {
  background: var(--ink);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: var(--s6);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: 0 var(--s2);
  text-decoration: none;
}

.side-brand img {
  height: 24px;
  display: block;
}

.side-brand .eyebrow {
  color: var(--on-dark-muted);
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side-nav a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s2);
  padding: 9px 10px;
  color: var(--on-dark-muted);
  font-weight: 500;
  font-size: 13.5px;
  text-decoration: none;
}

.side-nav a:hover {
  color: #fff;
}

.side-nav a[aria-current="page"] {
  color: #fff;
  background: var(--ink-2);
  box-shadow: inset 2px 0 0 var(--primary);
}

.side-label {
  padding: 0 10px;
  color: var(--disabled);
}

.side-foot {
  margin-top: auto;
  padding: 12px 10px 0;
  border-top: 1px solid var(--ink-2);
  display: flex;
  align-items: center;
  gap: 10px;
}

.side-foot .avatar {
  background: var(--page);
  color: var(--ink);
  width: 28px;
  height: 28px;
}

.side-foot .who {
  min-width: 0;
  flex: 1;
}

.side-foot .who-name {
  font-weight: 500;
  font-size: 12.5px;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-foot .who-sub {
  font-size: 11px;
  color: var(--on-dark-muted);
}

.side-foot a {
  color: var(--on-dark-muted);
  font-size: 12px;
}

.main {
  min-width: 0;
  padding: var(--s6) var(--s8) var(--s16);
}

.main-inner {
  max-width: var(--app-wrap);
}

@media (max-width: 960px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
  }

  .side {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--s3);
    padding: var(--s3) var(--s4);
  }

  .side-nav {
    flex-direction: row;
    overflow-x: auto;
    width: 100%;
    order: 3;
    scrollbar-width: none;
  }

  .side-nav::-webkit-scrollbar {
    display: none;
  }

  .side-nav a {
    white-space: nowrap;
  }

  .side-label {
    display: none;
  }

  .side-foot {
    margin: 0 0 0 auto;
    border: 0;
    padding: 0;
  }

  .side-foot .who {
    display: none;
  }

  .main {
    padding: var(--s5) var(--s4) var(--s12);
  }
}

/* Encabezado de pantalla dentro del panel */
.page-head {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  margin-bottom: var(--s6);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  font-size: 12.5px;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--ink);
}

.breadcrumb [aria-current] {
  color: var(--ink);
}

.tabs {
  position: relative;
  display: flex;
  gap: 22px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.tabs a {
  padding: 10px 0;
  font-weight: 500;
  font-size: 13.5px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.tabs a:hover {
  color: var(--ink);
}

.tabs a[aria-current="page"] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--primary);
}

/* Pie público */
.footer {
  background: var(--ink);
  color: var(--on-dark-muted);
  padding-block: var(--s12);
  font-size: 13.5px;
}

.footer a {
  color: var(--page);
  text-decoration: none;
}

.footer a:hover {
  color: var(--primary);
}

.footer-grid {
  display: grid;
  gap: var(--s8);
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 720px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.footer-bottom {
  margin-top: var(--s10);
  padding-top: var(--s6);
  border-top: 1px solid var(--ink-2);
  display: flex;
  justify-content: space-between;
  gap: var(--s3);
  flex-wrap: wrap;
  font-size: 12px;
}

/* Pantallas de acceso (ingresar, registro, revisión) */
.auth {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* The logo lines up with the storefront's container rather than the window
   edge, so the brand does not drift away from the form on a wide screen */
.auth-top {
  padding: var(--s5) max(var(--s6), calc((100% - var(--wrap)) / 2 + var(--s6)));
  border-bottom: 1px solid var(--border);
  background: var(--card);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s4);
}

.auth-body {
  flex: 1;
  padding: var(--s12) var(--s6);
}

.auth-card {
  max-width: 440px;
  margin-inline: auto;
  background: var(--card);
  border: 1px solid var(--border);
  padding: var(--s8);
}

/* Diálogo */
dialog.dialog {
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 0;
  width: min(520px, calc(100vw - 32px));
  background: var(--card);
  color: var(--text);
}

dialog.dialog::backdrop {
  background: rgba(35, 31, 32, 0.55);
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s4);
  padding: 18px var(--s6);
  border-bottom: 1px solid var(--sunken);
}

.dialog-body {
  padding: var(--s6);
}

.dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: var(--s3);
  padding: var(--s4) var(--s6);
  border-top: 1px solid var(--sunken);
  background: var(--page);
}

/* La cruz va centrada en su área de toque, y el área asoma sobre el margen:
   así el glifo queda a plomo con el borde del contenido y no adentrado */
.dialog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  font-family: var(--sans);
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  width: 44px;
  height: 44px;
  margin: -6px -10px -6px 0;
}

.dialog-close:hover {
  color: var(--ink);
}

/* Aviso efímero tras una acción */
.toast {
  position: fixed;
  left: 50%;
  bottom: var(--s6);
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: var(--s3);
  background: var(--ink);
  color: #fff;
  padding: var(--s3) var(--s4);
  font-size: 13.5px;
  max-width: calc(100vw - 32px);
}

.toast a {
  color: #fff;
  font-weight: 600;
  text-decoration-color: var(--primary);
}

/* --------------------------------------------------------------------------
   Maqueta de mail
   -------------------------------------------------------------------------- */
.mail-stage {
  padding: var(--s8) var(--s4) var(--s16);
}

.mail-meta {
  max-width: 600px;
  margin: 0 auto var(--s4);
  font-size: 12.5px;
  color: var(--muted);
  display: grid;
  gap: 2px;
}

.mail {
  max-width: 600px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
}

.mail-head {
  padding: var(--s6) var(--s8);
  border-bottom: 1px solid var(--sunken);
}

.mail-body {
  padding: var(--s8);
}

.mail-foot {
  padding: var(--s6) var(--s8);
  background: var(--ink);
  color: var(--on-dark-muted);
  font-size: 12px;
  line-height: 18px;
}

/* --------------------------------------------------------------------------
   Mini pedido — el pedido en curso, en un panel lateral, sin salir de la pantalla
   -------------------------------------------------------------------------- */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(35, 31, 32, 0.45);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.25s ease,
    visibility 0s linear 0.25s;
}

.drawer-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  transition:
    opacity 0.25s ease,
    visibility 0s;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 95;
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-left: 1px solid var(--ink);
  transform: translateX(100%);
  visibility: hidden;
  transition:
    transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility 0s linear 0.3s;
}

.drawer.is-open {
  transform: none;
  visibility: visible;
  transition:
    transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility 0s;
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s3);
  padding: var(--s4) var(--s5);
  border-bottom: 1px solid var(--ink);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--s4) var(--s5);
}

.drawer-foot {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  padding: var(--s4) var(--s5) calc(var(--s4) + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--ink);
  background: var(--page);
}

.drawer-group + .drawer-group {
  margin-top: var(--s5);
}

.drawer-group-name {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: var(--s2);
}

.drawer-line {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: var(--s3);
  padding-block: var(--s3);
  border-top: 1px solid var(--sunken);
}

.drawer-line:first-of-type {
  border-top: 0;
}

.drawer-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 14px;
  line-height: 18px;
  color: var(--ink);
}

.drawer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  margin-top: var(--s2);
}

@media (prefers-reduced-motion: reduce) {
  .drawer,
  .drawer-backdrop {
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   Precio con descuento (Etapa 2) y espacios patrocinados
   -------------------------------------------------------------------------- */
.price-was {
  white-space: nowrap;
  font-size: 12.5px;
  color: var(--disabled);
  text-decoration: line-through;
  font-variant-numeric: tabular-nums;
}

.price-off {
  font-weight: 600;
  font-size: 12px;
  color: var(--primary-ink);
  white-space: nowrap;
}

.banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  background: var(--ink);
  border: 1px solid var(--ink);
}

@media (min-width: 720px) {
  .banner {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    align-items: center;
  }
}

.banner-body {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  padding: var(--s6);
}

.banner-body .eyebrow {
  color: var(--primary);
}

.banner-body h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.15;
  color: var(--page);
}

.banner-body p {
  color: var(--on-dark-muted);
}

.banner-art {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: var(--s3);
  padding: var(--s5);
  border-top: 1px solid var(--ink-2);
}

@media (min-width: 720px) {
  .banner-art {
    border-top: 0;
    border-left: 1px solid var(--ink-2);
    align-self: stretch;
  }
}

/* Hueco de publicidad: se ve dónde va y qué mide, sin inventar un aviso */
.ad-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  padding: var(--s5);
  border: 1px dashed var(--muted);
  background: repeating-linear-gradient(-45deg, var(--card), var(--card) 10px, var(--page) 10px, var(--page) 20px);
  color: var(--muted);
  font-size: 12.5px;
}

/* --------------------------------------------------------------------------
   Celular: la cara del comprador se opera como una app
   - La barra superior no se va con el scroll.
   - La navegación baja a una barra de pestañas, al alcance del pulgar.
   - El pedido se abre como hoja desde abajo.
   -------------------------------------------------------------------------- */
.tabbar,
.actionbar,
.tcards,
.menu-btn {
  display: none;
}

/* El botón de menú solo existe en el celular, pero se define acá con el resto */
.menu-btn {
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.menu-links a {
  display: block;
  padding: 14px 0;
  border-top: 1px solid var(--sunken);
  font-family: var(--sans);
  font-weight: 500;
  font-size: 15px;
  color: var(--ink);
  text-decoration: none;
}

.menu-links a:first-child {
  border-top: 0;
}

@media (max-width: 959px) {
  .topbar {
    position: sticky;
    top: 0;
    z-index: 40;
  }

  /* Dos filas, como en cualquier tienda de celular: arriba el menú, la marca
     y lo que es de uno —el pedido y la cuenta—; abajo el buscador, ancho
     completo, que es lo que más se usa. */
  .topbar {
    padding-top: env(safe-area-inset-top, 0px);
  }

  .topbar-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    column-gap: var(--s2);
    row-gap: 8px;
    padding-block: 8px;
  }

  .topbar .menu-btn {
    display: inline-flex;
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    margin-left: -10px;
  }

  .topbar .logo {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    --x: 22px;
  }

  /* display en lugar de contents: si no, el carrito y la cuenta se colocan
     solos en la grilla y empujan al buscador fuera de su fila */
  .topbar-actions {
    display: flex;
    align-items: center;
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    gap: var(--s2);
    margin-right: -4px;
  }

  .topbar .search {
    grid-column: 1 / -1;
    grid-row: 2;
    width: auto;
    max-width: none;
    /* En el escritorio el buscador se centra con márgenes automáticos; acá eso
       lo achicaría al ancho de su contenido en lugar de ocupar la fila */
    margin-inline: 0;
    height: 40px;
  }

  /* Los enlaces de la barra pasan al menú, y el pedido a la barra de pestañas:
     ahí está el pulgar, y repetirlo arriba sería el mismo botón dos veces en
     la misma pantalla. Arriba queda la marca y la cuenta. */
  .topbar .topnav,
  .topbar .topbar-link,
  .topbar .topcart,
  .topbar-actions .btn-tertiary {
    display: none;
  }

  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 75;
    display: flex;
    background: var(--card);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .tabbar > * {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 58px;
    padding: 8px 4px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-family: var(--sans);
    font-weight: 500;
    font-size: 11px;
    line-height: 14px;
    text-decoration: none;
    cursor: pointer;
  }

  .tabbar > [aria-current="page"] {
    color: var(--ink);
    box-shadow: inset 0 2px 0 var(--primary);
  }

  .tabbar svg {
    display: block;
  }

  .tabbar .count-pill {
    position: absolute;
    top: 4px;
    left: 50%;
    margin-left: 4px;
  }

  .has-tabbar {
    padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  }

  /* El pedido, como hoja desde abajo */
  .drawer {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: 86vh;
    border-left: 0;
    border-top: 1px solid var(--ink);
    transform: translateY(100%);
  }

  .drawer.is-open {
    transform: none;
  }

  /* El menú no sube desde abajo: entra por el costado, como en una app */
  .drawer-menu {
    top: 0;
    right: auto;
    left: 0;
    bottom: 0;
    width: min(320px, 84%);
    max-height: none;
    border-top: 0;
    border-right: 1px solid var(--ink);
    transform: translateX(-100%);
  }

  .drawer-menu.is-open {
    transform: none;
  }

  /* El botón de filtros queda a mano, justo debajo de la barra superior,
     que mide lo que mide: la altura la publica el armazón */
  .filters-toggle {
    position: sticky;
    top: var(--topbar-h, 96px);
    z-index: 30;
  }

  /* Una tabla no se lee de costado: en el celular cada fila es una tarjeta,
     con su título arriba, los datos como pares y las acciones al pie */
  .table-wrap.has-cards {
    display: none;
  }

  .tcards {
    display: flex;
    flex-direction: column;
    gap: var(--s3);
  }

  .tcard {
    display: flex;
    flex-direction: column;
    gap: var(--s3);
    padding: var(--s4);
    background: var(--card);
    border: 1px solid var(--border);
  }

  .tcard-title {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 16px;
    line-height: 21px;
    color: var(--ink);
  }

  .tcard-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--s3);
    padding-block: 4px;
    border-top: 1px solid var(--sunken);
    font-size: 13.5px;
  }

  .tcard-row:first-child {
    border-top: 0;
  }

  .tcard-row dt {
    color: var(--muted);
    flex-shrink: 0;
  }

  .tcard-row dd {
    color: var(--ink);
    text-align: right;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .tcard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s2);
  }

  .tcard-actions .btn {
    flex: 1 1 auto;
  }

  /* Barra de acción del celular: lo que importa de la pantalla, fijo y a mano,
     justo encima de las pestañas */
  .actionbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(58px + env(safe-area-inset-bottom, 0px));
    z-index: 60;
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: var(--s3) var(--s4);
    background: var(--card);
    border-top: 1px solid var(--ink);
  }

  .actionbar .grow {
    flex: 1;
    min-width: 0;
  }

  .actionbar .btn {
    flex-shrink: 0;
  }

  .has-actionbar {
    padding-bottom: calc(132px + env(safe-area-inset-bottom, 0px));
  }

  /* La barra de prototipo no pisa las pestañas */
  .has-proto .proto {
    bottom: calc(58px + env(safe-area-inset-bottom, 0px) + 12px);
  }
}

/* --------------------------------------------------------------------------
   Barra de prototipo (no es parte del producto)
   -------------------------------------------------------------------------- */
.proto {
  position: fixed;
  right: var(--s4);
  bottom: var(--s4);
  z-index: 80;
  font-family: var(--sans);
}

.proto-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(35, 31, 32, 0.18);
}

.proto-toggle .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.proto-panel {
  position: absolute;
  right: 0;
  bottom: 44px;
  width: 300px;
  background: #fff;
  border: 1px solid var(--ink);
  box-shadow: 0 12px 32px rgba(35, 31, 32, 0.22);
  padding: var(--s4);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.proto-panel[hidden] {
  display: none;
}

.proto-panel .radio {
  font-size: 13px;
}

.proto-panel .radio small {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
}

/* The prototype bar is fixed: leave room so it never covers the last action */
.has-proto .footer,
.has-proto .main,
.has-proto .auth-body,
.has-proto .mail-stage {
  padding-bottom: 112px;
}

/* Catalogue filters fold away on a phone, behind a button */
.filters-toggle {
  display: none;
}

@media (max-width: 959px) {
  .filters-toggle {
    display: inline-flex;
  }

  .filters.is-collapsible:not(.is-open) {
    display: none;
  }

  /* Dentro de la hoja los filtros no son un panel aparte: ocupan todo el
     ancho, sin marco ni encabezado propio, porque la hoja ya los tiene */
  .drawer-filters .filters {
    display: flex;
    border: 0;
    padding: 0;
  }

  .drawer-filters .filters > .row-between,
  .drawer-filters .ad-slot {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Phones: 100 % usable, not merely unbroken
   - Touch targets of at least 44 px.
   - Inputs at 16 px: below that, iOS zooms the page on focus.
   - Micro type raised a step, since 10,5 px caps are hard to read in hand.
   - Tables keep their first column in view while the rest scrolls.
   -------------------------------------------------------------------------- */
@media (max-width: 720px) {
  .input,
  .select,
  .textarea,
  .search input,
  .stepper input,
  .stepper output {
    font-size: 16px;
  }

  .input,
  .select,
  .input-group,
  .search {
    height: 44px;
  }

  .input-group .input {
    height: 42px;
  }

  .btn:not(.btn-icon),
  .btn-sm:not(.btn-icon),
  .chip,
  .chip-applied,
  .segmented > *,
  .tabs a,
  .side-nav a {
    min-height: 44px;
  }

  .btn:not(.btn-icon) {
    min-width: 44px;
  }

  .chip,
  .chip-applied,
  .segmented > *,
  .tabs a,
  .side-nav a {
    display: inline-flex;
    align-items: center;
  }

  .btn-icon,
  .btn-icon.btn-sm {
    width: 44px;
    height: 44px;
  }

  .stepper {
    height: 44px;
  }

  .stepper button {
    width: 44px;
  }

  .account > summary .avatar {
    width: 44px;
    height: 44px;
  }

  .pagination a,
  .pagination span[aria-current] {
    min-width: 44px;
    height: 44px;
  }

  .check,
  .radio {
    min-height: 40px;
  }

  .eyebrow,
  .spec dt,
  .table th,
  .internal-flag,
  .tag {
    font-size: 11.5px;
  }

  .caption,
  .help,
  .field-error,
  .price-unit {
    font-size: 13px;
  }

  .label {
    font-size: 13.5px;
  }

  dialog.dialog {
    max-height: calc(100dvh - 24px);
    overflow: auto;
  }

  .dialog-close {
    width: 44px;
    height: 44px;
  }

  .dialog-foot {
    flex-wrap: wrap;
  }

  .table td:first-child,
  .table th:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    max-width: 45vw;
    background: var(--card);
    box-shadow: 1px 0 0 var(--sunken);
  }

  .proto-who {
    display: none;
  }
}

@media print {
  .proto,
  .skip-link {
    display: none;
  }
}

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