/* ==========================================================================
   CERVECERÍA FRANVA - CARTA DIGITAL EXCLUSIVA PARA CÓDIGO QR EN MESA
   Diseño ultra-simplificado, sin distracciones, lectura instantánea.
   ========================================================================== */

:root {
  --color-beer-gold: #D97706;
  --color-beer-dark: #92400E;
  --color-beer-light: #FDE68A;
  --color-wood-dark: #231710;
  --color-wood-medium: #3E291C;
  
  --bg-cream: #FAF7F2;
  --bg-white: #FFFFFF;
  --border-soft: #EAE2D7;
  --border-strong: #D5C9B8;

  --text-main: #1C1512;
  --text-muted: #5E524C;
  --text-light: #FDFBF7;

  --shadow-sm: 0 2px 5px rgba(35, 23, 16, 0.05);
  --shadow-md: 0 4px 12px rgba(35, 23, 16, 0.08);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-cream);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 1.05rem;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   1. CABECERA COMPACTA DE MESA (QR HEADER)
   -------------------------------------------------------------------------- */
.qr-header {
  background: linear-gradient(180deg, var(--color-wood-dark) 0%, #352317 100%);
  color: var(--text-light);
  padding: 1.25rem 1rem 1rem;
  border-bottom: 4px solid var(--color-beer-gold);
}

.qr-header-container {
  max-width: 680px;
  margin: 0 auto;
}

.brand-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.brand-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-beer-light);
  background: rgba(217, 119, 6, 0.25);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  margin-bottom: 0.25rem;
  letter-spacing: 0.03em;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 5vw, 2.1rem);
  font-weight: 800;
  line-height: 1.15;
  color: #FFFFFF;
}

.brand-subtitle {
  font-size: 0.95rem;
  color: #E6DCD2;
}

.btn-to-web {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background-color: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.2);
  white-space: nowrap;
  transition: background-color 0.15s;
}

.btn-to-web:active {
  background-color: rgba(255, 255, 255, 0.25);
}

.icon-arrow {
  width: 14px;
  height: 14px;
}

/* Banner de WiFi en mesa */
.table-info-banner {
  background-color: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.85rem;
}

.wifi-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #F8F4EE;
}

.wifi-icon {
  font-size: 1.1rem;
}

.wifi-text strong {
  color: var(--color-beer-light);
}

/* Buscador instantáneo */
.search-box-wrapper {
  margin-top: 0.25rem;
}

.search-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 1rem;
  font-size: 1.1rem;
  pointer-events: none;
}

#searchInput {
  width: 100%;
  padding: 0.85rem 2.5rem 0.85rem 2.8rem;
  background-color: #FFFFFF;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-main);
  outline: none;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
  transition: border-color 0.15s;
}

#searchInput:focus {
  border-color: var(--color-beer-gold);
}

#searchInput::placeholder {
  color: #796C64;
}

.clear-search-btn {
  position: absolute;
  right: 0.75rem;
  background: #E2E8F0;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   2. BARRA DE CATEGORÍAS FIJA (PILLS)
   -------------------------------------------------------------------------- */
.categories-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--bg-cream);
  border-bottom: 2px solid var(--border-soft);
  padding: 0.65rem 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.categories-container {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0 1rem;
  max-width: 680px;
  margin: 0 auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.categories-container::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-pill);
  background-color: #FFFFFF;
  border: 1.5px solid var(--border-strong);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
  min-height: 44px;
}

.cat-pill:hover {
  border-color: var(--color-beer-gold);
}

.cat-pill.active {
  background-color: var(--color-wood-dark);
  color: #FFFFFF;
  border-color: var(--color-wood-dark);
  box-shadow: 0 2px 8px rgba(35, 23, 16, 0.25);
}

.cat-pill.active .cat-icon {
  transform: scale(1.1);
}

/* --------------------------------------------------------------------------
   3. CONTENIDO PRINCIPAL: LISTA DE PLATOS
   -------------------------------------------------------------------------- */
.menu-content-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

.menu-section {
  margin-bottom: 2.25rem;
}

.section-title-sticky {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-strong);
}

.section-name {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--color-wood-dark);
}

.section-count {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
}

.dishes-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

/* Tarjeta individual de plato */
.dish-card {
  background-color: var(--bg-white);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.dish-card.highlight {
  border-left: 4px solid var(--color-beer-gold);
  background-color: #FFFDF9;
}

.dish-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.85rem;
}

.dish-title-group {
  flex: 1;
}

.dish-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-wood-dark);
  line-height: 1.25;
}

.dish-price-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

.dish-price {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: #B45309;
  background-color: #FEF3C7;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  line-height: 1.1;
}

.dish-price small {
  font-size: 0.8rem;
  font-weight: 600;
}

.dish-price-alt {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.dish-desc {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.dish-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  padding-top: 0.35rem;
}

/* Badges y etiquetas */
.badge-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  margin-top: 0.25rem;
}

.badge-gold {
  background-color: #FEF3C7;
  color: #92400E;
  border: 1px solid #FCD34D;
}

.badge-red {
  background-color: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FCA5A5;
}

.badge-green {
  background-color: #DCFCE7;
  color: #166534;
  border: 1px solid #86EFAC;
}

.badge-blue {
  background-color: #DBEAFE;
  color: #1E40AF;
  border: 1px solid #BFDBFE;
}

.allergen-pill {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  background-color: #F1F5F9;
  color: #475569;
}

.allergen-pill.free {
  background-color: #ECFDF5;
  color: #065F46;
  font-weight: 700;
}

.portion-hint {
  font-size: 0.85rem;
  font-weight: 600;
  color: #8C6D58;
  margin-left: auto;
}

/* --------------------------------------------------------------------------
   4. ESTADO DE BÚSQUEDA SIN RESULTADOS
   -------------------------------------------------------------------------- */
.no-results-msg {
  text-align: center;
  background-color: #FFFFFF;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 2.5rem 1.5rem;
  margin: 1.5rem 0;
}

.no-results-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.5rem;
}

.no-results-msg h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--color-wood-dark);
  margin-bottom: 0.4rem;
}

.no-results-msg p {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 1.25rem;
}

.btn-reset {
  background-color: var(--color-beer-gold);
  color: #1A120B;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  border: none;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   5. AVISO DE ALERGIAS Y ACCIONES EN MESA
   -------------------------------------------------------------------------- */
.table-footer-callout {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.allergy-notice-box {
  background-color: #FEF3C7;
  border: 1.5px solid #F59E0B;
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.allergy-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.allergy-notice-box h4 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #92400E;
  margin-bottom: 0.2rem;
}

.allergy-notice-box p {
  font-size: 0.95rem;
  color: #78350F;
  margin: 0;
  line-height: 1.4;
}

.table-actions-box {
  background-color: #FFFFFF;
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
}

.order-hint {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-wood-dark);
  margin-bottom: 0.85rem;
}

.table-btns-row {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.btn-call-waiter,
.btn-wa-table {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.9rem 1.25rem;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #FFFFFF;
  min-height: 52px;
  touch-action: manipulation;
}

.btn-call-waiter {
  background-color: #B91C1C;
}

.btn-call-waiter:active {
  background-color: #991B1B;
}

.btn-wa-table {
  background-color: #1EBE5D;
}

.btn-wa-table:active {
  background-color: #15803D;
}

.btn-icon-svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   6. PIE MINIMALISTA DE LA CARTA
   -------------------------------------------------------------------------- */
.qr-simple-footer {
  background-color: var(--color-wood-dark);
  color: #CFC5BC;
  padding: 1.75rem 1rem 2rem;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.qr-footer-content {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.tax-notice {
  font-size: 0.85rem;
  opacity: 0.8;
}

.link-back-home {
  color: var(--color-beer-light);
  font-weight: 700;
  font-size: 0.95rem;
  margin-top: 0.5rem;
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   7. RESPONSIVIDAD PARA TABLETS O PANTALLAS MÁS ANCHAS
   -------------------------------------------------------------------------- */
@media (min-width: 600px) {
  .table-btns-row {
    flex-direction: row;
  }
  .table-btns-row .btn-call-waiter,
  .table-btns-row .btn-wa-table {
    flex: 1;
  }
}
