/* Mobile overrides (640 px), burger menu, date input fixes, backdrop-filter fallback */
@media (max-width: 640px) {

  /* Cart items on mobile */
  .cart-item {
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 14px;
  }

  .cart-item-name {
    font-size: 0.9rem;
    width: 100%;
  }

  .cart-item-qty {
    flex-shrink: 0;
  }

  .cart-item-price {
    font-size: 0.9rem;
    min-width: 60px;
  }

  .cart-item-remove {
    padding: 4px 8px;
    min-height: 32px;
  }

  /* Receipt table on mobile */
  .receipt-table td {
    font-size: 0.78rem;
    padding: 6px 0;
  }

  .receipt-table td:first-child {
    max-width: 60%;
    word-break: break-word;
    padding-right: 8px;
  }

  .receipt-table .total-row td {
    font-size: 1rem;
  }

  /* Promo code and min order on mobile */
  #min-order-notice {
    font-size: 0.75rem;
    padding: 8px 12px;
  }

  /* Form fields on mobile */
  .fg input,
  .fg select,
  .fg textarea {
    font-size: 16px !important;
  }

  /* Order type buttons */
  .order-type-row {
    flex-direction: row;
    gap: 8px;
  }

  .ot-label {
    font-size: 0.78rem;
    padding: 10px 8px;
  }

  /* Cart panel header */
  .cart-panel h3 {
    font-size: 1.2rem;
  }

  /* Pay button */
  .btn-pay {
    font-size: 0.82rem;
    padding: 18px;
    letter-spacing: 0.12em;
    min-height: 56px;
    touch-action: manipulation;
  }

  /* Overlay header */
  .overlay-header {
    padding: 14px 16px;
    gap: 12px;
  }

  .overlay-header>* {
    flex-shrink: 0;
  }

  /* Cart page extra bottom padding for fixed cart button */
  #cart-page .overlay-content {
    padding-bottom: 100px;
  }

  /* Promo deals sub */
}

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
  z-index: 1000;
  cursor: none !important;
}

.burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s;
}

nav.scrolled .burger span {
  background: #1a0a06;
}

.burger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.burger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.burger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

#mobileMenu {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 10, 6, 0.97);
  z-index: 850;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
}

#mobileMenu.open {
  display: flex;
}

.mob-link {
  font-family: "Playfair Display", serif;
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  padding: 18px 40px;
  letter-spacing: 0.06em;
  border-bottom: 1px solid rgba(139, 26, 43, 0.2);
  width: 100%;
  text-align: center;
  transition:
    color 0.2s,
    background 0.2s;
}

.mob-link:hover {
  color: #8b1a2b;
  background: rgba(139, 26, 43, 0.08);
}

.mob-link.mob-order {
  background: #8b1a2b;
  color: #fff;
  margin-top: 24px;
  border: none;
  border-radius: 2px;
  width: 80%;
  max-width: 300px;
}

.mob-link.mob-order:hover {
  background: #6a1320;
}

.mob-link.mob-catering {
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  border-radius: 2px;
  width: 80%;
  max-width: 300px;
  margin-top: 8px;
}

@media (max-width: 640px) {
  nav ul {
    display: none;
  }

  .burger {
    display: flex;
  }
}

input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  z-index: 2;
  background: #fff;
  border: 1px solid rgba(139, 26, 43, 0.3);
  color: #1a0a06;
  padding: 12px 16px;
  font-size: 0.88rem;
  border-radius: 2px;
  width: 100%;
  min-height: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  position: absolute;
  right: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 3;
}

input[type="date"]:focus {
  border-color: #8b1a2b;
  outline: none;
}

input[type="date"]:invalid {
  background: #eeeeee;
  color: #777;
}

@supports not (backdrop-filter: blur(1px)) {
  .menu-card {
    background: rgba(255, 255, 255, 0.97) !important;
    border-color: rgba(139, 26, 43, 0.15) !important;
  }

  #tutaBackdrop {
    background: rgba(26, 10, 6, 0.75) !important;
  }

  .overlay-header {
    background: rgba(255, 255, 255, 1) !important;
  }
}