/* Cafetería Los Bocoles - Mobile-First Stylesheet */
:root {
  --primary: #c2410c; /* Terracotta Comal */
  --primary-dark: #9a3412;
  --primary-light: #ffedd5;
  --secondary: #d97706; /* Warm Amber */
  --secondary-light: #fef3c7;
  --accent-green: #15803d; /* Huasteco Jalapeño Green */
  --accent-green-light: #dcfce7;
  --accent-red: #dc2626;
  --bg-cream: #faf7f2;
  --card-bg: #ffffff;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --border-color: #e5e7eb;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-up: 0 -4px 16px rgba(0, 0, 0, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-cream);
  color: var(--text-main);
  line-height: 1.5;
  padding-bottom: 95px; /* Room for floating cart bar */
}

/* CABECERA ESTILO DELIVERY APP: FOTO LIMPIA Y TARJETA BLANCA DEBAJO */
.restaurant-header {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 0;
  background-color: #ffffff;
}

/* 1. Banner superior: foto de la fachada 100% limpia y visible (200px en móvil, 280px en escritorio) */
.restaurant-banner {
  position: relative;
  width: 100%;
  height: 200px;
  background-color: #f3f4f6;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

.banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  filter: none !important;
}

/* 2. Tarjeta blanca con información justo debajo de la foto (sin margen negativo ni encimado) */
.restaurant-info-card {
  position: relative;
  background-color: #ffffff;
  padding: 14px 16px 16px;
  max-width: 960px;
  margin: 0 auto;
  margin-top: 0 !important;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.info-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.brand-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo-wrap {
  width: 84px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.1));
}

.official-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-details {
  min-width: 0;
}

.brand-title {
  font-size: 1.28rem;
  font-weight: 800;
  color: #111827;
  line-height: 1.2;
  margin: 0;
}

.tagline {
  font-size: 0.84rem;
  color: var(--primary);
  font-weight: 700;
  margin-top: 2px;
  margin-bottom: 0;
}

.status-badge-wrap {
  flex-shrink: 0;
}

/* STATUS BADGE */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.open {
  background-color: #22c55e;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.35);
}

.status-badge.closed {
  background-color: #ef4444;
  color: #ffffff;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #ffffff;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 5px rgba(255, 255, 255, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

/* LÍNEA DE DIRECCIÓN COMPACTA */
.store-address-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #4b5563;
  margin-bottom: 12px;
}

.address-pin {
  font-size: 0.95rem;
  flex-shrink: 0;
}

.address-text {
  font-weight: 500;
  color: #374151;
}

/* 3. ACCIONES DE CONTACTO Y REDES DIRECTO EN FILA / GRID FLEXIBLE */
.info-actions-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.pill-facebook {
  background-color: #1877F2;
  color: #ffffff !important;
  box-shadow: 0 2px 5px rgba(24, 119, 242, 0.25);
}

.pill-facebook:hover, .pill-facebook:active {
  background-color: #166fe5;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(24, 119, 242, 0.35);
}

.pill-instagram {
  background: linear-gradient(45deg, #f09433, #e4405f, #bc2a8d);
  color: #ffffff !important;
  box-shadow: 0 2px 5px rgba(228, 64, 95, 0.25);
}

.pill-instagram:hover, .pill-instagram:active {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(228, 64, 95, 0.35);
}

.pill-whatsapp {
  background-color: #25D366;
  color: #ffffff !important;
  box-shadow: 0 2px 5px rgba(37, 211, 102, 0.25);
}

.pill-whatsapp:hover, .pill-whatsapp:active {
  background-color: #1eb855;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37, 211, 102, 0.35);
}

.pill-call {
  background-color: #f0fdf4;
  color: #15803d !important;
  border: 1px solid #bbf7d0;
}

.pill-call:hover, .pill-call:active {
  background-color: #dcfce7;
  transform: translateY(-1px);
}

.pill-maps {
  background-color: #eff6ff;
  color: #1d4ed8 !important;
  border: 1px solid #bfdbfe;
}

.pill-maps:hover, .pill-maps:active {
  background-color: #dbeafe;
  transform: translateY(-1px);
}

/* STICKY CATEGORY TABS */
.tabs-wrapper {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: var(--bg-cream);
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.category-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px;
}

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

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background-color: #ffffff;
  border: 1.5px solid #e5e7eb;
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.tab-btn:active, .tab-btn.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(194, 65, 12, 0.3);
}

/* MAIN MENU CONTAINER */
.menu-container {
  padding: 16px;
  max-width: 800px;
  margin: 0 auto;
}

.category-section {
  margin-bottom: 28px;
  scroll-margin-top: 75px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.section-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #374151;
}

.section-count {
  font-size: 0.8rem;
  font-weight: 600;
  background-color: #e5e7eb;
  color: #4b5563;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* PRODUCT CARD */
.product-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.product-card {
  background-color: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid transparent;
  display: flex;
  gap: 14px;
  position: relative;
  transition: all 0.2s ease;
}

.product-card.has-items {
  border-color: var(--secondary);
  background-color: #fffefb;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.12);
}

.product-card.unavailable {
  opacity: 0.65;
  filter: grayscale(40%);
}

.product-img-wrap {
  width: 105px;
  height: 105px;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  background-color: #f3f4f6;
}

.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background-color: var(--primary);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}

.sold-out-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.product-details {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
}

.product-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
  line-height: 1.25;
}

.product-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.product-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-dark);
}

/* QUICK QUANTITY SELECTOR (+ / -) */
.quantity-control {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #f3f4f6;
  border-radius: var(--radius-full);
  padding: 4px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.qty-btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  border: none;
  background-color: #ffffff;
  color: var(--primary);
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.15s ease;
  user-select: none;
}

.qty-btn:active {
  transform: scale(0.9);
  background-color: var(--primary);
  color: #ffffff;
}

.qty-count {
  font-size: 0.95rem;
  font-weight: 800;
  min-width: 20px;
  text-align: center;
  color: #1f2937;
}

/* FLOATING BOTTOM CART BAR */
.floating-cart-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: var(--shadow-up);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(110%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-cart-bar.visible {
  transform: translateY(0);
}

.cart-bar-inner {
  width: 100%;
  max-width: 800px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-bar-summary {
  display: flex;
  flex-direction: column;
}

.cart-bar-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.cart-bar-total {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.checkout-trigger-btn {
  background: linear-gradient(135deg, var(--primary) 0%, #ea580c 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-full);
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(194, 65, 12, 0.4);
  transition: all 0.2s ease;
}

.checkout-trigger-btn:active {
  transform: scale(0.97);
}

/* CHECKOUT MODAL & BOTTOM SHEET */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.checkout-sheet {
  background-color: #ffffff;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  overflow-y: auto;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.25);
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.modal-overlay.active .checkout-sheet {
  transform: translateY(0);
}

.sheet-handle {
  width: 44px;
  height: 5px;
  background-color: #d1d5db;
  border-radius: var(--radius-full);
  margin: 10px auto 4px;
  flex-shrink: 0;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-color);
}

.sheet-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #111827;
}

.close-btn {
  background: #f3f4f6;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #4b5563;
}

.sheet-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* SEGMENTED DELIVERY TOGGLE */
.segmented-control {
  display: flex;
  background-color: #f3f4f6;
  padding: 4px;
  border-radius: var(--radius-full);
  gap: 4px;
}

.segment-btn {
  flex: 1;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: var(--radius-full);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.segment-btn.active {
  background-color: #ffffff;
  color: var(--primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* LEAFLET MAP & LOCATION */
.map-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.geo-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background-color: var(--secondary-light);
  color: #92400e;
  border: 1.5px dashed var(--secondary);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.geo-btn:active {
  background-color: #fde68a;
}

#map-container {
  height: 200px;
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  z-index: 1;
}

.map-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* FORM FIELDS */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #374151;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #d1d5db;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.15);
}

/* PAYMENT SELECTOR */
.payment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.payment-card {
  border: 2px solid #e5e7eb;
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.9rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.payment-card.selected {
  border-color: var(--primary);
  background-color: var(--primary-light);
  color: var(--primary-dark);
}

.change-calculator-box {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.change-result {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent-green);
  display: flex;
  justify-content: space-between;
}

/* ORDER ITEMS PREVIEW IN CHECKOUT */
.order-summary-box {
  background-color: #f9fafb;
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 160px;
  overflow-y: auto;
}

.order-summary-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: #374151;
}

.order-summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: #4b5563;
}

.order-summary-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-dark);
  padding-top: 8px;
  border-top: 1.5px dashed #d1d5db;
}

/* WHATSAPP ACTION BUTTON */
.btn-whatsapp-order {
  background-color: #25D366;
  color: #ffffff;
  border: none;
  border-radius: var(--radius-full);
  padding: 16px;
  font-size: 1.05rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
  transition: all 0.2s ease;
}

.btn-whatsapp-order:hover, .btn-whatsapp-order:active {
  background-color: #1eb855;
  transform: translateY(-1px);
}

.btn-whatsapp-order svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* PICKUP INFO CARD */
.pickup-info-card {
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 14px;
  color: #1e40af;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
}

/* TOAST NOTIFICATION */
.toast-msg {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: #1f2937;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 200;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-msg.show {
  transform: translateX(-50%) translateY(0);
}

/* RESPONSIVE DESKTOP ADJUSTMENTS */
@media (min-width: 640px) {
  .modal-overlay {
    align-items: center;
    padding: 20px;
  }
  
  .checkout-sheet {
    border-radius: 20px;
    max-height: 85vh;
  }
  
  .product-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  
  .restaurant-banner {
    height: 280px;
  }
  
  .restaurant-info-card {
    padding: 18px 24px 20px;
  }
  
  .brand-logo-wrap {
    width: 104px;
    height: 74px;
  }
  
  .brand-title {
    font-size: 1.6rem;
  }
}
