:root {
  --header-height: 82px;
  --line: #27272e;
  --gold: #e5b042;
  --gold-light: #f3cc77;
  --gold-dark: #b88927;
  --panel: #0d0d0e;
  --brand-surface: #151518;
  --brand-card: #1b1b20;
  --white: #f7f7f7;
  --muted: #8e8e99;
}

html {
  scrollbar-gutter: stable;
}

@view-transition {
  navigation: auto;
}

body {
  --header-height: 82px;
  padding-top: var(--header-height);
}
body.cart-open {
  overflow: hidden;
}
body.cart-open .topbar {
  backdrop-filter: none;
}

.topbar,
.topbar *,
.header-cart,
.header-cart * {
  box-sizing: border-box;
}

.topbar {
  view-transition-name: site-header;
  font-family: Inter, Arial, sans-serif;
  height: 82px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(180px, auto) 1fr minmax(120px, auto);
  align-items: center;
  padding: 0 16px;
  background: rgba(13, 13, 14, 0.95);
  border-top: 1px solid #343434;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.logo {
  display: inline-flex;
  align-items: center;
  height: 58px;
  text-decoration: none;
}
.logo img {
  display: block;
  height: 100%;
  width: auto;
  max-width: 220px;
}

.nav {
  display: flex;
  justify-content: center;
  gap: clamp(14px, 2vw, 34px);
  flex-wrap: nowrap;
  white-space: nowrap;
}
.nav a {
  color: #a7a7ae;
  text-decoration: none;
  text-transform: uppercase;
  font-size: clamp(13.5px, 1.4vw, 16px);
  font-weight: 800;
  letter-spacing: clamp(2px, 0.3vw, 3.5px);
  padding: 30px 0 12px;
  border-bottom: 1px solid transparent;
  touch-action: manipulation;
  white-space: nowrap;
}
.nav a:hover,
.nav a[aria-current="page"] {
  color: #fff;
  border-color: var(--gold);
}
.nav a:active {
  color: var(--gold-light);
  border-color: var(--gold-light);
  opacity: 0.85;
  transform: scale(0.97);
  transition: transform 0.05s ease;
}

.header-actions {
  display: flex;
  justify-self: end;
  align-items: center;
  gap: 8px;
}

.cart-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 104px;
  height: 39px;
  min-width: 104px;
  max-width: 104px;
  min-height: 39px;
  max-height: 39px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.25);
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-family: Inter, Arial, sans-serif;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 2px;
  text-transform: uppercase;
  white-space: nowrap;
  transition: border-color .18s ease;
}
.cart-trigger:hover {
  border-color: var(--gold);
}
.cart-trigger-count {
  margin-left: 6px;
  color: var(--gold-light);
}

/* Header Cart (Panel desplegable estilo Stitch) */
.header-cart {
  position: fixed;
  top: var(--header-cart-offset, 82px);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: #0d0d0e;
  box-shadow: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: cart-fade-in .22s ease-out;
}
.header-cart[hidden] {
  display: none;
}
@keyframes cart-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.header-cart-inner {
  max-width: 540px;
  margin: 0 auto;
  padding: 10px 18px 48px;
}

/* Cart Panel Header */
.cart-panel-head {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 2px 38px 8px 0;
  border-bottom: 1px solid #27272e;
  margin-bottom: 12px;
}
.cart-panel-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cart-panel-head h2 {
  margin: 0;
  font: 700 17px Oswald, Inter, sans-serif;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #fff;
}
.cart-pulse-badge {
  display: none;
}
.cart-pulse-dot {
  display: none;
}

.cart-close {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #27272e;
  border-radius: 50%;
  background: #151518;
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.cart-close svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
.cart-close:hover,
.cart-close:focus-visible {
  background: #1b1b20;
  border-color: var(--gold);
  color: var(--gold-light);
  transform: translateY(-50%) scale(1.05);
  outline: none;
}
.cart-count {
  display: none;
}

/* Cart Items List */
.cart-items {
  list-style: none;
  margin: 12px 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Dish items: Rounded-2xl cards in bg-brand-surface (#151518) */
.cart-line {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 10px !important;
  padding: 16px 18px !important;
  background: #151518 !important;
  border: 1px solid #27272e !important;
  border-radius: 16px;
  font-size: 13px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  transition: border-color .2s ease;
}
.cart-line:hover {
  border-color: rgba(229, 176, 66, 0.25);
}
.cart-line-top {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 4px;
}
.cart-item-category {
  display: inline-block;
  align-self: flex-start;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold-light);
  background: rgba(229, 176, 66, 0.12);
  border: 1px solid rgba(229, 176, 66, 0.25);
  border-radius: 4px;
  padding: 2px 7px;
  margin-bottom: 2px;
}
.cart-line-name {
  margin: 0;
  font-family: Oswald, Inter, sans-serif;
  font-weight: 700;
  color: #fff;
  font-size: 15px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.cart-line-desc {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
}
.cart-line-bottom,
.cart-line-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(39, 39, 46, 0.8);
  padding-top: 10px;
}
.cart-line-bottom {
  align-items: center;
}
.cart-line-price-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cart-line-total {
  font-size: 15px;
  font-weight: 800;
  color: var(--gold-light);
  white-space: nowrap;
}
.cart-line-unit-price {
  font-size: 11px;
  color: var(--muted);
}

/* Ergonomic Pill Stepper (rounded-full, bg-brand-card with + and -) */
.header-cart .cart-quantity,
.cart-quantity {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: #1b1b20;
  border: 1px solid #27272e;
  border-radius: 9999px;
  padding: 2px 4px;
}
.header-cart .cart-count-value,
.cart-count-value {
  display: inline-block;
  min-width: 24px;
  text-align: center;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.header-cart .cart-action,
.cart-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--gold-light);
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s ease, transform 0.1s ease, color 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.cart-action:hover,
.cart-action:focus-visible {
  background: rgba(229, 176, 66, 0.18);
  color: #fff;
  outline: none;
}
.cart-action:active {
  transform: scale(0.92);
  background: rgba(229, 176, 66, 0.28);
}

.cart-clear {
  margin: 4px 0 18px auto;
  display: block;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  transition: color .18s ease;
}
.cart-clear:hover {
  color: #ff5252;
}

.cart-total {
  display: none;
}

.cart-bag-fee-row:not([hidden]) {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
}
.cart-bag-fee-row strong {
  color: var(--gold-light);
  white-space: nowrap;
}

/* Delivery selector: Domicilio / Recoger en local segmented toggle */
.delivery-mode-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: #151518;
  border: 1px solid #27272e;
  border-radius: 12px;
  margin-bottom: 16px;
}
.delivery-mode-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s ease;
}
.delivery-mode-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
.delivery-mode-btn.active,
.delivery-mode-btn[aria-pressed="true"] {
  background: #1b1b20;
  color: var(--gold-light);
  border: 1px solid rgba(229, 176, 66, 0.35);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Checkout Form */
.checkout-form {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}
.checkout-form [hidden],
.checkout-field[hidden],
.checkout-grid-2col[hidden],
.delivery-zone-picker[hidden],
.delivery-zone-label[hidden],
.checkout-field-change[hidden],
.checkout-change-amount-wrap[hidden] {
  display: none !important;
}
.checkout-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.checkout-form label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.checkout-form label svg {
  width: 13px;
  height: 13px;
  fill: var(--gold);
}
.checkout-input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  margin-bottom: 14px;
}
.checkout-input-pin {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--gold);
  pointer-events: none;
  z-index: 2;
}
.checkout-input-icon-wrap input {
  margin-bottom: 0 !important;
  padding-left: 40px !important;
}
.checkout-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 480px) {
  .checkout-grid-2col {
    grid-template-columns: 1fr;
  }
}
.checkout-form input,
.checkout-form select,
.checkout-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid #27272e;
  border-radius: 10px;
  background: #151518;
  color: #fff;
  font-family: Inter, Arial, sans-serif;
  font-size: 14px;
  transition: border-color .18s ease, background .18s ease;
}
.checkout-form input:focus,
.checkout-form select:focus,
.checkout-form textarea:focus {
  border-color: var(--gold);
  background: #1b1b20;
  outline: none;
}
.checkout-form textarea {
  resize: vertical;
  min-height: 72px;
}

.checkout-field-change {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-top: -2px;
  margin-bottom: 2px;
}
.checkout-checkbox-label {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  cursor: pointer;
  color: #fff !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  user-select: none;
}
.checkout-checkbox-label input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  border: 1px solid #27272e !important;
  border-radius: 4px !important;
  background: #151518 !important;
  accent-color: var(--gold) !important;
  cursor: pointer;
  padding: 0 !important;
  margin: 0 !important;
}
.checkout-change-amount-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

/* Summary Breakdown */
.checkout-summary {
  display: grid;
  gap: 10px;
  margin: 12px 0 16px;
  padding: 10px 0 4px;
  background: transparent;
  border: 0;
  font-size: 13px;
}
.checkout-summary div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: var(--muted);
}
.checkout-summary .checkout-summary-total,
.checkout-summary div:last-child {
  padding-top: 12px;
  border-top: 1px solid #27272e;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}
.checkout-summary .checkout-summary-total small {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 4px;
}
.checkout-summary strong {
  color: #fff;
  white-space: nowrap;
}
.checkout-summary .checkout-summary-total strong,
.checkout-summary div:last-child strong {
  color: var(--gold-light);
  font-size: 22px;
  font-family: Oswald, Inter, sans-serif;
  letter-spacing: 0.5px;
}

/* Fixed Bottom Bar / Submit Button */
.cart-bottom-bar {
  position: sticky;
  bottom: 0;
  background: #0d0d0e;
  padding-top: 12px;
  padding-bottom: 6px;
  margin-top: 10px;
  border-top: 1px solid #27272e;
}
.checkout-submit {
  width: 100%;
  min-height: 52px;
  padding: 12px 18px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #f3cc77 0%, #e5b042 50%, #b88927 100%);
  color: #0d0d0e;
  font-family: Inter, Arial, sans-serif;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(229, 176, 66, 0.35);
  transition: transform 0.12s ease, filter 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.checkout-submit-content {
  display: flex;
  align-items: center;
  gap: 10px;
}
.checkout-submit svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}
.checkout-submit-total-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(13, 13, 14, 0.25);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  font-family: Oswald, Inter, sans-serif;
  letter-spacing: 0.5px;
}
.checkout-submit-total-badge svg {
  width: 14px;
  height: 14px;
}
.checkout-submit:hover:not(:disabled) {
  filter: brightness(1.08);
  box-shadow: 0 6px 24px rgba(229, 176, 66, 0.45);
}
.checkout-submit:active:not(:disabled) {
  transform: scale(0.98);
  filter: brightness(0.95);
}
.checkout-submit:disabled {
  opacity: .45;
  cursor: not-allowed;
  box-shadow: none;
}
.checkout-submit[data-submitting="true"] {
  opacity: 0.85;
  cursor: wait;
  filter: brightness(0.95);
}

/* Call link below submit */
.cart-call-link {
  display: block;
  text-align: center;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
  transition: color .18s ease;
}
.cart-call-link:hover {
  color: var(--gold-light);
}

.cart-empty {
  padding: 32px 16px;
  text-align: center;
  background: #151518;
  border: 1px dashed #27272e;
  border-radius: 16px;
  color: var(--muted);
  font-size: 13px;
}
.checkout-minimum {
  margin: 0 0 12px;
  padding: 8px 12px;
  background: rgba(229, 176, 66, 0.08);
  border: 1px solid rgba(229, 176, 66, 0.22);
  border-radius: 8px;
  color: var(--gold-light);
  font-size: 12px;
  line-height: 1.4;
}
.checkout-minimum:empty {
  display: none;
}


/* Responsive unificado para todas las pantallas */
@media (max-width: 1200px) {

  :root,
  body {
    --header-height: 92px;
  }
  .topbar {
    grid-template-columns: auto 1fr;
    width: 100%;
    height: 92px;
    min-height: 92px;
    padding: 8px 16px;
    gap: 6px;
    border-top: 0;
    background: rgba(10,10,10,.96);
  }
  .logo {
    height: 40px !important;
  }
  .logo img {
    max-width: 150px !important;
  }
  .nav {
    display: flex;
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: center;
    gap: clamp(8px, 1.8vw, 18px);
    overflow-x: auto;
    scrollbar-width: none;
    flex-wrap: nowrap;
    white-space: nowrap;
  }
  .nav::-webkit-scrollbar {
    display: none;
  }
  .nav a {
    padding: 6px 0 4px;
    font-size: clamp(10.5px, 1.25vw, 12.5px);
    letter-spacing: clamp(1.2px, 0.25vw, 2px);
    white-space: nowrap;
  }
  .header-actions {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }
  .cart-trigger {
    width: 96px;
    height: 34px;
    min-width: 96px;
    max-width: 96px;
    min-height: 34px;
    max-height: 34px;
    padding: 0 10px;
    font-size: 8px;
    letter-spacing: 1.5px;
  }
  .header-cart {
    top: var(--header-cart-offset, 92px);
  }
  .header-cart-inner {
    padding: 22px 18px 48px;
  }
  .cart-close {
    width: 36px;
    height: 36px;
    font-size: 24px;
  }
}

@media (max-width: 700px) {
  :root,
  body {
    --header-height: 92px;
  }
  .topbar {
    height: 92px !important;
    min-height: 92px !important;
    padding: 8px 16px !important;
    gap: 6px !important;
  }
  .logo {
    height: 40px !important;
  }
  .logo img {
    max-width: 150px !important;
  }
  .nav {
    display: flex;
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: center;
    gap: clamp(8px, 1.8vw, 18px);
    overflow-x: auto;
    scrollbar-width: none;
    flex-wrap: nowrap;
    white-space: nowrap;
  }
  .nav::-webkit-scrollbar {
    display: none;
  }
  .nav a {
    padding: 6px 0 4px !important;
    font-size: clamp(10.5px, 1.25vw, 12.5px) !important;
    letter-spacing: clamp(1.2px, 0.25vw, 2px) !important;
    white-space: nowrap;
  }
  .header-cart {
    top: var(--header-cart-offset, 92px);
  }
  .cart-trigger {
    width: 96px;
    height: 34px;
    min-width: 96px;
    max-width: 96px;
    min-height: 34px;
    max-height: 34px;
    padding: 0 10px;
    font-size: 8px;
    letter-spacing: 1.5px;
  }
  .header-cart .cart-action,
  .cart-action {
    min-width: 40px;
    min-height: 40px;
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
}

/* Add to cart button feedback, flyer particle and header cart vibration */
.add-to-cart {
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease, background-color 0.2s ease, color 0.2s ease;
}
.add-to-cart:active {
  transform: scale(0.92);
}
.add-to-cart.just-added {
  background: transparent !important;
  color: var(--gold-light) !important;
}

.cart-flyer {
  position: fixed;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0%, var(--gold-light) 40%, var(--gold) 100%);
  box-shadow: 0 0 16px rgba(229, 176, 66, 0.9), 0 0 4px #fff;
  z-index: 9999;
  pointer-events: none;
  transform: translate3d(0, 0, 0) scale(1.2);
  transition: transform 0.78s cubic-bezier(0.22, 0.85, 0.36, 1), opacity 0.78s ease-in;
  will-change: transform, opacity;
}

@keyframes cart-shake {
  0% { transform: scale(1) rotate(0deg); }
  20% { transform: scale(1.12) rotate(-6deg); }
  40% { transform: scale(1.15) rotate(6deg); }
  60% { transform: scale(1.12) rotate(-4deg); }
  80% { transform: scale(1.06) rotate(3deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.cart-trigger.cart-shake {
  animation: cart-shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
