/* 1. Base y accesibilidad. */
html:has(.menu-page) {
  color-scheme: light;
  background: var(--brand-cream);
}

.menu-page {
  --menu-surface: var(--text-dark);
  --muted: #d9d3bd;
  display: flex;
  flex-direction: column;
  background: var(--brand-cream);
  color: var(--text-dark);
}

.menu-page button, .menu-page input, .menu-page textarea {
  font-family: var(--font-body);
}

.menu-page button, .menu-page a, .menu-page input, .menu-page textarea {
  -webkit-tap-highlight-color: transparent;
}

.menu-page button {
  cursor: pointer;
  touch-action: manipulation;
}

.menu-page button:disabled {
  cursor: default;
  opacity: .4;
}

.menu-page a {
  color: inherit;
}

.menu-page :focus-visible {
  outline: 3px solid #f9c412;
  outline-offset: 4px;
}

.menu-page [hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: -80px;
  left: 20px;
  z-index: 40;
  padding: 14px;
  background: var(--brand-cream);
  color: var(--brand-red) !important;
}

.skip-link:focus {
  top: 12px;
}

/* 2. Barra superior y categorías. */
.menu-header.glass-link {
  position: sticky;
  top: 0;
  z-index: 5;
  display: block;
  min-height: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  font: inherit;
  text-align: left;
  cursor: auto;
  touch-action: auto;
  transition: none;
  transform: none;
}

.menu-header.glass-link:hover, .menu-header.glass-link:active {
  transform: none;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  max-width: 1200px;
  margin: auto;
  padding: 14px 32px;
}

.menu-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.menu-brand img {
  width: 52px;
  height: auto;
}

.menu-brand strong {
  display: block;
  font: 400 28px/1 var(--font-display);
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.menu-control {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 17px;
  color: var(--brand-cream);
  font-size: 14px;
  font-weight: 700;
  border: 1px solid rgb(255 252 223 / .24);
  border-radius: 16px;
  background: rgb(255 252 223 / .045);
}

.menu-control:hover {
  background: rgb(255 252 223 / .12);
}

.cart-count {
  display: grid;
  place-items: center;
  min-width: 23px;
  height: 23px;
  padding-inline: 5px;
  border-radius: 50%;
  font-size: 12px;
  background: var(--brand-cream);
  color: var(--brand-red);
}

.cart-icon, .menu-icon {
  display: block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.category-navigation {
  position: relative;
  z-index: 2;
}

.category-navigation-inner {
  display: grid;
  grid-template-columns: 34px minmax(0,1fr) 34px;
  align-items: center;
  gap: 12px;
  max-width: 1200px;
  padding: 16px 32px 0;
  margin: 0 auto;
}

.category-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 108px) / 7);
  gap: 18px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  list-style: none;
  padding: 12px 0 20px;
  margin: 0;
}

.category-track::-webkit-scrollbar {
  display: none;
}

.category-slide {
  min-width: 0;
  scroll-snap-align: start;
}

.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 3px;
  text-align: center;
  text-decoration: none;
  border-radius: 16px;
}

.category-circle.glass-link {
  display: block;
  flex: none;
  width: 96px;
  height: 96px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
}

.category-circle img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  border-radius: inherit;
  object-fit: cover;
}

.category-label {
  min-height: 36px;
  font: 400 14px/1.3 var(--font-display);
  overflow-wrap: anywhere;
}

.category-item[aria-current="page"] {
  color: var(--brand-red);
}

.category-item[aria-current="page"] .category-circle {
  border: 2px solid var(--brand-red);
}

.category-item[aria-current="page"] .category-label {
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.category-arrow {
  display: grid;
  place-items: center;
  width: 34px;
  height: 60px;
  margin-bottom: 36px;
  padding: 7px;
  border: 0;
  border-radius: 12px;
  background: var(--brand-red);
  color: var(--brand-cream);
}

.category-arrow svg {
  width: 22px;
  height: 22px;
}

/* 3. Desplazamiento dentro de las ventanas; el marco permanece fijo. */
.search-scroll, .cart-content, .cart-scroll {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb, rgb(255 252 223 / .32)) transparent;
}

.search-scroll::-webkit-scrollbar, .cart-content::-webkit-scrollbar, .cart-scroll::-webkit-scrollbar {
  width: 6px;
}

.search-scroll::-webkit-scrollbar-track, .cart-content::-webkit-scrollbar-track, .cart-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.search-scroll::-webkit-scrollbar-thumb, .cart-content::-webkit-scrollbar-thumb, .cart-scroll::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb, rgb(255 252 223 / .32));
  border-radius: 999px;
}

.search-scroll::-webkit-scrollbar-thumb:hover, .cart-content::-webkit-scrollbar-thumb:hover, .cart-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover, rgb(255 252 223 / .5));
}

.search-scroll::-webkit-scrollbar-button, .cart-content::-webkit-scrollbar-button, .cart-scroll::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.search-scroll::-webkit-scrollbar-corner, .cart-content::-webkit-scrollbar-corner, .cart-scroll::-webkit-scrollbar-corner {
  background: transparent;
}

@supports selector(::-webkit-scrollbar) {
  .search-scroll, .cart-content, .cart-scroll {
    scrollbar-width: auto;
    scrollbar-color: auto;
  }
}

/* 4. Secciones de la carta y tarjetas. Espacio vertical aprobado. */
.menu-main {
  position: relative;
  z-index: 1;
  width: min(100% - 64px, 1136px);
  margin: 0 auto;
  padding: 7.67px 0 44px;
  flex: 1;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 10px;
  letter-spacing: .14em;
  font-weight: 500;
}

.menu-main > [data-menu-category] {
  scroll-margin-top: 135px;
}

.menu-main > [data-menu-category] ~ [data-menu-category] {
  margin-top: 44px;
}

.menu-main.is-filtered > [data-menu-category] {
  margin-top: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;
  color: var(--brand-red);
  font: 400 34px/1.15 var(--font-display);
}

.section-heading > span {
  font-size: 14px;
  font-weight: 700;
  opacity: .7;
}

.category-note {
  margin: -6px 0 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 20px;
}

.product-card.glass-link {
  display: block;
  height: 160px;
  min-height: 0;
  padding: 0;
  gap: 0;
  text-align: left;
}

/* Cristal oscuro: tinte del neutral de marca, fondo visible y luz en los bordes.
backdrop-filter procesa el fondo; la fotografía superpuesta sigue intacta. */
.glass-dark.glass-link {
  color-scheme: dark;
  color: var(--brand-cream);
  background: linear-gradient(165deg, rgb(35 31 32 / .56), rgb(35 31 32 / .66) 47%, rgb(35 31 32 / .48));
  border-color: rgb(255 252 223 / .24);
  -webkit-backdrop-filter: blur(5px) saturate(1.08);
  backdrop-filter: blur(5px) saturate(1.08);
  box-shadow: 0 8px 22px rgb(35 31 32 / .25), inset 0 1px 1px rgb(255 252 223 / .28), inset 0 -2px 3px rgb(255 252 223 / .09), inset 2px 0 4px rgb(255 252 223 / .05);
}

/* Blanco cálido derivado del crema de marca, completamente opaco. */
.product-card.glass-dark, .category-circle.glass-link {
  --menu-surface: var(--surface-light);
  background: var(--menu-surface);
  color: var(--text-dark);
  border-color: rgb(122 93 45 / .24);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.category-circle.glass-link {
  box-shadow: 0 8px 22px rgb(35 31 32 / .25), inset 0 1px 1px rgb(255 252 223 / .28), inset 0 -2px 3px rgb(255 252 223 / .09), inset 2px 0 4px rgb(255 252 223 / .05);
}

.glass-dark.glass-link::before {
  background: radial-gradient(ellipse 62% 145% at var(--pointer-x) var(--pointer-y), rgb(255 252 223 / .055), transparent 73%);
}

.glass-dark.glass-link::after {
  background: linear-gradient(145deg, rgb(255 252 223 / .5), rgb(255 252 223 / .025) 40%, rgb(255 252 223 / .04) 61%, rgb(255 252 223 / .32));
}

/* Mismo rojo sólido de la barra superior. */
.mobile-cart.glass-dark {
  background: var(--brand-red);
  font-weight: 700;
}

.menu-header.glass-dark {
  background: var(--brand-red);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: 0 8px 22px rgb(35 31 32 / .25);
}

/* Barra superior con el rojo oficial sólido de la marca. */
.menu-header.glass-link::before, .menu-header.glass-link::after {
  display: none;
}

@media (hover:hover) and (pointer:fine) {
  .glass-dark.glass-link:not(.menu-header):hover {
    box-shadow: 0 12px 26px rgb(35 31 32 / .32), inset 0 1px 1px rgb(255 252 223 / .4), inset 0 -2px 4px rgb(255 252 223 / .15);
  }
}

.product-open {
  position: relative;
  display: grid;
  grid-template-columns: 40% 1fr;
  width: 100%;
  min-height: 0;
  height: 100%;
  padding: 0;
  border: 0;
  text-align: left;
  background: transparent;
  color: inherit;
}

.product-photo {
  position: absolute;
  inset: 8px auto 8px 8px;
  width: calc(40% - 16px);
  height: calc(100% - 16px);
  overflow: hidden;
  border-radius: 20px;
  background: var(--menu-surface);
}

.product-card .product-open {
  z-index: 1;
}

.product-thumbnail {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: center;
  opacity: 1;
  filter: none;
}

.photo-placeholder {
  display: grid;
  place-items: center;
  background: #302a2b;
  color: rgb(255 252 223 / .45);
  font: 400 11px/1.5 var(--font-body);
}

/* Sin fotografía, su espacio conserva el fondo de la tarjeta. */
.product-card .product-photo.photo-placeholder {
  background: transparent;
  color: var(--text-muted);
}

.product-info {
  position: relative;
  grid-column: 2;
  height: 100%;
  min-height: 0;
  padding: 14px 14px 44px;
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 0;
  min-width: 0;
  text-align: left;
}

.product-info > span {
  flex-shrink: 0;
}

.product-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--brand-red);
  font: 400 18px/1.15 var(--font-display);
  margin-bottom: 6px;
}

.product-description {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  font-size: 12.5px;
  line-height: 1.4;
  color: inherit;
}

.product-price {
  position: absolute;
  bottom: 15px;
  left: 14px;
  color: var(--brand-red);
  font-size: 14px;
  padding-right: 34px;
  font-weight: 700;
}

.quick-add.glass-link {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  gap: 0;
  width: 30px;
  height: 30px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  background: var(--brand-red);
  font-size: 22px;
  line-height: 1;
}

.order-explainer {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 44px 0 0;
  padding-top: 24px;
  border-top: 1px solid rgb(122 93 45 / .2);
}

.explainer-number {
  display: grid;
  place-items: center;
  border: 1px solid rgb(139 2 3 / .3);
  color: var(--brand-red-dark);
  border-radius: 50%;
  width: 25px;
  height: 25px;
  font-size: 11px;
  flex-shrink: 0;
}

.order-explainer p {
  font-size: 12px;
  margin: 0 26px 0 0;
  color: var(--text-muted);
}

.menu-footer {
  position: relative;
  z-index: 1;
  width: min(100% - 64px,1136px);
  padding: 24px 0;
  margin: 0 auto;
  font-size: 11px;
  border-top: 1px solid rgb(122 93 45 / .2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
}

.menu-footer a {
  text-decoration: none;
}

.menu-footer p {
  margin: 0;
  line-height: 1.5;
}

/* 5. Ventanas, formulario de producto y controles comunes. */
.menu-page dialog {
  position: fixed;
  max-width: none;
  max-height: none;
  padding: 0;
  border: 1px solid rgb(255 252 223 / .22);
  border-radius: 28px;
  color: var(--brand-cream);
  background: var(--menu-surface);
  box-shadow: 0 24px 100px rgb(0 0 0 / .4);
}

.menu-page dialog::backdrop {
  background: rgb(35 31 32 / .65);
  backdrop-filter: blur(6px);
}

.product-dialog.glass-link {
  display: none;
  width: min(1280px,calc(100% - 48px),calc(200dvh - 128px));
  height: min(640px,calc(50vw - 24px),calc(100dvh - 64px));
  min-height: 0;
  padding: 0;
  gap: 0;
  text-align: left;
  cursor: auto;
  touch-action: auto;
  transition: none;
}

.product-dialog.glass-link[open] {
  display: block;
}

.product-dialog.glass-link:hover, .product-dialog.glass-link:active,
.cart-dialog.glass-link:hover, .cart-dialog.glass-link:active,
.search-dialog.glass-link:hover, .search-dialog.glass-link:active {
  transform: none;
  background-color: transparent;
}

.menu-page .product-dialog::backdrop, .menu-page .cart-dialog::backdrop, .menu-page .search-dialog::backdrop {
  background: rgb(35 31 32 / .35);
}

.product-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100%;
  min-height: 0;
}

.product-visual {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  margin: 8px;
  overflow: hidden;
  border-radius: 20px;
  background: transparent;
}

.product-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  min-height: 0;
  opacity: 1;
  filter: none;
}

.product-visual.photo-placeholder {
  background: transparent;
}

.product-form {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.close-control {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: 1px solid rgb(255 252 223 / .22);
  border-radius: 50%;
  color: var(--brand-cream);
  background: rgb(255 252 223 / .04);
  font-size: 26px;
  line-height: 1;
  z-index: 2;
}

.product-form > .close-control {
  position: absolute;
  right: 12px;
  top: 12px;
}

.product-options {
  flex: 1;
  overflow-y: auto;
  padding: 32px 32px 24px;
  scrollbar-color: #756e60 transparent;
}

.product-options > .eyebrow {
  padding-right: 35px;
}

.product-options h2 {
  margin: 0 25px 8px 0;
  font: 400 38px/1.08 var(--font-display);
}

.detail-price {
  font-size: 18px;
  margin: 10px 0 12px;
}

.detail-description {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.option-group {
  border: 0;
  padding: 0;
  margin: 0 0 26px;
}

.option-group legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 0;
  font-size: 15px;
  font-weight: 500;
}

.option-group legend span {
  font-size: 9px;
  background: var(--brand-red-dark);
  padding: 5px 8px;
  border-radius: 7px;
  font-weight: 400;
}

.option-hint {
  margin: 8px 0 10px;
  font-size: 11px;
  color: var(--muted);
}

.choice {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  min-height: 54px;
  padding: 12px 14px;
  border: 1px solid rgb(255 252 223 / .15);
  border-radius: 13px;
  margin-top: 8px;
  cursor: pointer;
  font-size: 14px;
}

.choice:has(input:checked) {
  border-color: var(--brand-cream);
  background: rgb(255 252 223 / .07);
}

.choice input {
  accent-color: var(--brand-red);
  width: 20px;
  height: 20px;
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.choice-surcharge {
  display: block;
  font-size: 11px;
  line-height: 1.5;
  margin-top: 4px;
  color: var(--muted);
}

.field-error {
  margin: 10px 0 0;
  font-size: 12px;
  color: #f9c412;
  line-height: 1.4;
}

.notes-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  gap: 12px;
  margin-bottom: 10px;
}

.notes-label > span {
  font-size: 10px;
  color: var(--muted);
}

.menu-page textarea, .search-dialog input {
  display: block;
  width: 100%;
  color: var(--brand-cream);
  background: rgb(255 252 223 / .035);
  border: 1px solid rgb(255 252 223 / .2);
  border-radius: 13px;
  padding: 13px;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
}

.menu-page textarea::placeholder, .search-dialog input::placeholder {
  color: #aaa596;
}

.note-caption {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.5;
}

.product-action-bar {
  display: flex;
  flex-shrink: 0;
  gap: 14px;
  padding: 18px 22px;
  background: rgb(35 31 32 / .2);
  border-top: 1px solid rgb(255 252 223 / .16);
}

.quantity-picker {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  height: 48px;
  border: 1px solid rgb(255 252 223 / .2);
  border-radius: 16px;
  overflow: hidden;
}

.quantity-picker button {
  width: 40px;
  height: 46px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 20px;
}

.quantity-picker input {
  width: 38px;
  height: 46px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: center;
  font-size: 14px;
  appearance: textfield;
}

.quantity-picker input::-webkit-inner-spin-button {
  appearance: none;
}

.primary-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 48px;
  padding: 13px 20px;
  border: 1px solid rgb(255 252 223 / .28);
  border-radius: 18px;
  color: var(--brand-cream);
  background: var(--brand-red);
  font: 500 14px/1.4 var(--font-body);
  text-decoration: none;
}

.primary-action:hover {
  background: #ca1a21;
}

.primary-action strong {
  white-space: nowrap;
  font-weight: 500;
}

/* Tema claro compartido por las tres ventanas, en todos sus estados. */
:is(.product-dialog, .cart-dialog, .search-dialog).glass-link,
:is(.product-dialog, .cart-dialog, .search-dialog).glass-link:hover,
:is(.product-dialog, .cart-dialog, .search-dialog).glass-link:active {
  --menu-surface: var(--surface-light);
  --muted: var(--text-muted);
  color-scheme: light;
  color: var(--text-dark);
  background: var(--menu-surface);
  border-color: rgb(122 93 45 / .24);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.product-dialog {
  --product-accent: var(--brand-red);
}

.product-dialog .product-visual.photo-placeholder {
  color: var(--muted);
  font-size: 12px;
}

.product-dialog .detail-price {
  font-weight: 700;
}

/* Tamaños aprobados para los textos secundarios de todos los productos. */
.product-dialog .detail-description,
.product-dialog .notes-label {
  font-size: 14px;
}

.product-dialog .option-group legend {
  font-size: 16px;
}

.product-dialog .option-group legend span {
  font-size: 10px;
}

.product-dialog .option-hint {
  font-size: 12px;
}

.product-dialog .choice,
.product-dialog textarea,
.product-dialog .quantity-picker input,
.product-dialog #product-submit-label {
  font-size: 15px;
}

.product-dialog .field-error {
  font-size: 13px;
}

.product-dialog .notes-label > span,
.product-dialog .note-caption {
  font-size: 11px;
}

.product-dialog .eyebrow,
.product-dialog .detail-price {
  color: var(--product-accent);
}

.product-dialog .product-options h2 {
  color: var(--brand-red);
}

.product-dialog .close-control {
  color: var(--product-accent);
  border-color: rgb(139 2 3 / .24);
  background: var(--menu-surface);
}

.product-dialog .option-group legend span {
  color: var(--brand-cream);
  background: var(--product-accent);
}

.product-dialog .choice,
.product-dialog .quantity-picker {
  border-color: rgb(122 93 45 / .3);
}

.product-dialog .choice:has(input:checked) {
  border-color: var(--brand-red-dark);
  background: rgb(139 2 3 / .06);
}

.product-dialog textarea {
  color: var(--text-dark);
  background: var(--menu-surface);
  border-color: rgb(122 93 45 / .3);
}

.product-dialog textarea::placeholder {
  color: var(--muted);
}

.product-dialog .field-error {
  color: var(--product-accent);
}

.product-dialog .product-action-bar {
  background: var(--menu-surface);
  border-top-color: rgb(122 93 45 / .2);
}

/* 6. Carrito: artículos, acciones y resumen. */
.cart-dialog {
  width: 410px;
  height: 100dvh;
  inset: 0 0 0 auto;
  margin: 0;
  border-radius: 28px 0 0 28px !important;
}

.cart-dialog.glass-link {
  display: none;
  align-items: stretch;
  min-height: 0;
  gap: 0;
  text-align: left;
  cursor: auto;
  touch-action: auto;
  transition: none;
}

.cart-dialog.glass-link[open] {
  display: flex;
  flex-direction: column;
}

.dialog-header {
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgb(255 252 223 / .14);
  flex-shrink: 0;
}

.dialog-header h2 {
  margin: 0;
  font: 400 32px/1.1 var(--font-heading);
}

.dialog-header .eyebrow {
  font-size: 9px;
  opacity: .8;
}

.cart-scroll {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
}

.cart-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 24px;
}

.cart-item {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 14px;
  padding: 20px 0;
  border-bottom: 1px solid rgb(255 252 223 / .14);
}

.cart-item img {
  width: 62px;
  height: 74px;
  object-fit: cover;
  object-position: center 65%;
  border-radius: 12px;
}

.cart-photo {
  width: 62px;
  height: 74px;
  border-radius: 12px;
}

.cart-item h3 {
  font: 400 23px/1.12 var(--font-heading);
  margin: 0 0 8px;
}

.item-description {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
  margin: 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.item-price {
  display: block;
  margin-top: 10px;
  font-size: 14px;
}

.item-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.item-quantity {
  display: flex;
  align-items: center;
  border: 1px solid rgb(255 252 223 / .18);
  border-radius: 12px;
}

.item-quantity button {
  border: 0;
  min-width: 34px;
  min-height: 38px;
  color: inherit;
  background: transparent;
  font-size: 18px;
}

.item-quantity > span {
  min-width: 24px;
  text-align: center;
  font-size: 12px;
}

.item-edit, .remove-item {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgb(255 252 223 / .18);
  border-radius: 12px;
  color: inherit;
  background: transparent;
  font-size: 11px;
}

#order-note-label {
  margin-top: 24px;
}

.empty-cart {
  text-align: center;
  padding: 44px 0;
}

.empty-symbol {
  font-size: 38px;
}

.empty-cart h3 {
  font: 400 30px/1.2 var(--font-heading);
  margin: 20px 0 8px;
}

.empty-cart p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.secondary-action {
  min-height: 44px;
  border-radius: 16px;
  border: 1px solid rgb(255 252 223 / .4);
  padding: 10px 18px;
  background: transparent;
  color: inherit;
  font-size: 13px;
}

.cart-bottom {
  border-top: 1px solid rgb(255 252 223 / .16);
  padding: 22px 24px max(24px,env(safe-area-inset-bottom));
}

.total-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 14px;
  line-height: 1.5;
}

.total-row strong {
  white-space: nowrap;
  font-size: 18px;
  font-weight: 500;
}

.delivery-note {
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
  margin: 8px 0 20px;
}

.whatsapp-action {
  justify-content: center;
}

/* Barras de desplazamiento sobre fondos claros. */
:is(.cart-dialog, .search-dialog) {
  --scrollbar-thumb: rgb(122 93 45 / .42);
  --scrollbar-thumb-hover: rgb(122 93 45 / .6);
}

.cart-dialog .dialog-header {
  border-bottom-color: rgb(122 93 45 / .2);
}

.cart-dialog .dialog-header h2,
.cart-dialog .cart-item h3,
.cart-dialog .empty-cart h3 {
  font-family: var(--font-display);
  color: var(--brand-red);
}

.cart-dialog .eyebrow {
  color: var(--brand-red);
}

.cart-dialog .close-control {
  color: var(--brand-red);
  border-color: rgb(184 24 29 / .24);
  background: var(--menu-surface);
}

.cart-dialog .cart-item {
  border-bottom-color: rgb(122 93 45 / .2);
}

.cart-dialog .cart-photo.photo-placeholder {
  background: var(--brand-cream);
  color: var(--muted);
}

.cart-dialog .item-price,
.cart-dialog .total-row strong {
  color: var(--brand-red);
  font-weight: 700;
}

.cart-dialog .item-quantity {
  border-color: rgb(122 93 45 / .3);
}

.cart-dialog .item-quantity button {
  color: var(--brand-red);
}

.cart-dialog .item-edit,
.cart-dialog .remove-item,
.cart-dialog .secondary-action {
  color: var(--brand-red);
  border-color: rgb(184 24 29 / .3);
}

.cart-dialog textarea {
  color: var(--text-dark);
  background: var(--menu-surface);
  border-color: rgb(122 93 45 / .3);
}

.cart-dialog textarea::placeholder {
  color: var(--muted);
}

.cart-dialog .cart-bottom {
  background: var(--menu-surface);
  border-top-color: rgb(122 93 45 / .2);
}

.cart-dialog .whatsapp-action {
  color: var(--brand-cream);
}

/* 7. Búsqueda. Altura estable incluso sin coincidencias. */
.search-dialog {
  width: min(520px,calc(100% - 32px));
  height: calc(100dvh - 48px);
  max-height: calc(100dvh - 48px) !important;
  overflow: hidden;
}

.search-scroll {
  height: 100%;
  max-height: calc(100dvh - 50px);
  overflow-y: auto;
}

.search-dialog.glass-link {
  display: none;
  width: min(520px,calc(100% - 32px));
  min-height: 0;
  padding: 0;
  text-align: left;
  cursor: auto;
  touch-action: auto;
  transition: none;
  transform: none;
}

.search-dialog.glass-link[open] {
  display: block;
}

.search-dialog .dialog-header {
  padding: 20px;
  border-bottom-color: rgb(122 93 45 / .2);
}

.search-dialog h2 {
  font: 400 28px/1.1 var(--font-display);
  color: var(--brand-red);
}

.search-dialog .close-control {
  color: var(--brand-red);
  border-color: rgb(184 24 29 / .24);
  background: var(--menu-surface);
}

.search-dialog input {
  width: calc(100% - 40px);
  margin: 20px;
  font-size: 16px;
  color: var(--text-dark);
  background: var(--menu-surface);
  border-color: rgb(122 93 45 / .3);
}

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

.search-result {
  display: flex;
  width: calc(100% - 40px);
  padding: 12px;
  margin: 0 20px 20px;
  align-items: center;
  gap: 14px;
  background: var(--menu-surface);
  color: inherit;
  border: 1px solid rgb(122 93 45 / .24);
  border-radius: 15px;
  box-shadow: 0 8px 22px rgb(35 31 32 / .12);
  text-align: left;
}

.search-result img {
  width: 50px;
  height: 60px;
  object-fit: cover;
  object-position: center 65%;
  border-radius: 8px;
}

.search-photo {
  display: block;
  width: 50px;
  height: 60px;
  border-radius: 8px;
  flex-shrink: 0;
}

.search-photo.photo-placeholder {
  background: transparent;
  color: var(--muted);
}

.search-result strong {
  display: block;
  font: 400 18px/1.15 var(--font-display);
  color: var(--brand-red);
}

.search-result small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.search-result-price {
  color: var(--brand-red);
  font-weight: 700;
}

.search-result > span:last-child {
  margin-left: auto;
  color: var(--brand-red);
}

#search-empty {
  margin: 0 20px 24px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

/* 8. Botón móvil y adaptación a tamaños de pantalla. */
.mobile-cart {
  display: none;
}

.mobile-cart.glass-link:hover, .mobile-cart.glass-link:active {
  transform: none;
}

body.modal-open {
  overflow: hidden;
}

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

  .category-track {
    grid-auto-columns: calc((100% - 72px) / 5);
  }
}

@media (max-width:740px) {
  .header-inner {
    padding: 12px 16px;
    gap: 12px;
    flex-wrap: wrap;
  }

  .menu-brand {
    gap: 9px;
  }

  .menu-brand img {
    width: 44px;
  }

  .menu-brand strong {
    font-size: 24px;
  }

  .header-actions {
    gap: 7px;
    flex: 1;
    justify-content: flex-end;
  }

  .menu-control {
    padding: 9px 12px;
    font-size: 12px;
    border-radius: 14px;
  }

  .category-navigation-inner {
    display: block;
    padding: 8px 0 0;
  }

  .category-track {
    grid-auto-columns: 88px;
    gap: 14px;
    padding: 12px 16px;
    scroll-padding-inline: 16px;
  }

  .category-circle.glass-link {
    width: 76px;
    height: 76px;
  }

  .category-item {
    gap: 10px;
  }

  .category-label {
    font-size: 12px;
    min-height: 32px;
  }

  .category-arrow {
    display: none;
  }

  .menu-main {
    width: calc(100% - 32px);
    padding-top: 15.93px;
  }

  .section-heading h2 {
    font-size: 30px;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .product-open {
    min-height: 0;
    grid-template-columns: 40% 1fr;
  }

  .order-explainer {
    gap: 10px;
    display: grid;
    grid-template-columns: 25px 1fr;
    margin-top: 30px;
  }

  .order-explainer p {
    margin: 0;
    font-size: 12px;
  }

  .menu-footer {
    width: calc(100% - 32px);
    flex-direction: column;
    align-items: flex-start;
    font-size: 10px;
    padding-bottom: max(28px,env(safe-area-inset-bottom));
  }

  .menu-page.has-cart {
    padding-bottom: calc(84px + env(safe-area-inset-bottom));
  }

  .mobile-cart {
    position: fixed;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    bottom: max(14px,env(safe-area-inset-bottom));
    left: 16px;
    width: calc(100% - 32px);
    z-index: 4;
    min-height: 56px;
    border-radius: 20px;
    border: 1px solid rgb(255 252 223 / .45);
    padding: 14px 20px;
    font-size: 14px;
    line-height: 1.5;
  }

  .mobile-cart span span {
    opacity: .6;
    margin-left: 8px;
  }

  .mobile-cart strong {
    font-weight: 700;
  }

  .product-dialog.glass-link {
    inset: auto 0 0;
    margin: 0;
    width: 100%;
    height: 92dvh;
    border-radius: 24px 24px 0 0 !important;
  }

  .product-layout {
    display: block;
    overflow-y: auto;
    height: 100%;
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }

  .product-visual {
    height: auto;
    aspect-ratio: 1;
  }

  .product-visual img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .product-form {
    position: static;
    min-height: 0;
  }

  .product-form > .close-control {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--menu-surface);
  }

  .product-options {
    overflow: visible;
    padding: 24px 20px;
    flex: 1;
  }

  .product-options h2 {
    font-size: 32px;
  }

  .product-options > .eyebrow {
    font-size: 9px;
  }

  .detail-description {
    font-size: 13px;
    margin-bottom: 22px;
  }

  .detail-price {
    font-size: 17px;
  }

  .option-group legend {
    font-size: 14px;
  }

  .choice {
    min-height: 54px;
  }

  .product-action-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1;
    padding: 14px 16px max(14px,env(safe-area-inset-bottom));
    gap: 10px;
  }

  .product-action-bar .primary-action {
    padding: 12px 14px;
    font-size: 13px;
    border-radius: 16px;
  }

  .quantity-picker {
    height: 48px;
  }

  .quantity-picker button {
    width: 35px;
  }

  .quantity-picker input {
    width: 28px;
  }

  .menu-page textarea {
    font-size: 16px;
  }

  .product-dialog .option-group legend {
    font-size: 15px;
  }

  .product-dialog textarea {
    font-size: 17px;
  }

  .product-dialog #product-submit-label {
    font-size: 14px;
  }

  .cart-dialog {
    inset: auto 0 0;
    width: 100%;
    height: 88dvh;
    border-radius: 24px 24px 0 0 !important;
  }

  .dialog-header {
    padding: 20px;
  }

  .dialog-header h2 {
    font-size: 30px;
  }

  .cart-content {
    padding: 18px 20px;
  }

  .cart-bottom {
    padding: 18px 20px max(20px,env(safe-area-inset-bottom));
  }
}

@media (max-width:480px) {
  .header-actions {
    flex: none;
    gap: 6px;
  }

  .menu-control {
    padding: 9px 10px;
  }

  .menu-brand img {
    width: 42px;
  }

  .menu-brand strong {
    font-size: 23px;
  }

  .menu-brand {
    gap: 7px;
  }

  .header-inner {
    gap: 8px;
    flex-wrap: nowrap;
  }

  .cart-count {
    width: 21px;
    min-width: 21px;
    height: 21px;
    font-size: 10px;
  }

  .cart-control {
    gap: 6px;
  }
}

@media (max-width:360px) {
  .menu-brand strong {
    font-size: 21px;
  }

  .menu-brand img {
    width: 34px;
  }

  .menu-control {
    padding: 8px;
    font-size: 11px;
  }

  .product-description {
    font-size: 12px;
  }

  .primary-action {
    padding: 12px 14px;
  }
}

/* Reorganiza únicamente la cabecera cuando la primera fila no cabe. */
@media (max-width:340px) {
  .header-inner {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 0;
    padding-bottom: 12px;
  }

  .header-actions {
    display: grid;
    grid-template-columns: auto auto;
    justify-content: center;
    width: 100%;
  }

  .menu-main > section {
    scroll-margin-top: 180px !important;
  }
}

/* El marco de cristal queda fijo; con poca altura se desplaza todo su interior. */
@media (max-height:500px) {
  .cart-dialog {
    overflow: hidden;
  }

  .cart-dialog.glass-link[open] {
    display: block;
  }

  .cart-scroll {
    display: block;
    height: 100%;
    overflow-y: auto;
  }

  .cart-content {
    overflow: visible;
  }
}

/* 9. Preferencias de visualización y alternativas del navegador. */
@media (prefers-reduced-transparency:reduce) {
  .menu-page dialog::backdrop {
    backdrop-filter: none;
    background: #231f20d9;
  }

  .glass-dark.glass-link {
    background: var(--menu-surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .menu-header.glass-dark {
    background: var(--brand-red);
  }

  .mobile-cart.glass-dark {
    background: var(--brand-red);
  }

  .menu-header.glass-link::before {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .glass-dark.glass-link::before {
    background: none;
  }

  .menu-page .product-dialog::backdrop, .menu-page .cart-dialog::backdrop, .menu-page .search-dialog::backdrop {
    background: #231f20d9;
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass-dark.glass-link {
    background: var(--menu-surface);
  }

  .menu-header.glass-dark {
    background: var(--brand-red);
  }

  .mobile-cart.glass-dark {
    background: var(--brand-red);
  }
}

@media (forced-colors:active) {
  .glass-dark.glass-link {
    color: ButtonText;
    background: Canvas;
    border-color: ButtonText;
    box-shadow: none;
  }
}
