/* =====================================================
   JALAO RESTAURANT — CLIENT STYLES
   Elegant Light Theme · Mobile First
   ===================================================== */

/* ---------- CSS VARIABLES ---------- */
:root {
  /* ---- Backgrounds (fondo blanco) ---- */
  --bg-primary:    #FFFFFF;
  --bg-secondary:  #F8FEF4;
  --bg-card:       #FFFFFF;
  --bg-card-hover: #F5FDE6;
  --bg-input:      #FAFFF5;
  --bg-overlay:    rgba(0,0,0,0.72);

  /* ---- Accent: naranja (#FF9934) ---- */
  --accent:        #FF9934;
  --accent-light:  #FFC018;
  --accent-dark:   #CC7A20;
  --accent-glow:   rgba(255,153,52,0.15);

  /* ---- Gold → dorado (#FFC018) para estrellas ---- */
  --gold:          #FFC018;
  --gold-dim:      #FFD870;

  /* ---- Green → oliva (#B3C631) ---- */
  --green:         #B3C631;

  /* ---- Red → naranja intenso ---- */
  --red:           #FF9934;

  /* ---- Text ---- */
  --text-primary:  #1A1A0A;
  --text-secondary:#5A4A20;
  --text-muted:    #8A7A50;

  /* ---- Borders ---- */
  --border:        rgba(0,0,0,0.08);
  --border-accent: rgba(255,153,52,0.30);

  /* ---- Radii ---- */
  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --radius-xl:  28px;
  --radius-pill:999px;

  /* ---- Shadows ---- */
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.08);
  --shadow-md:  0 4px 20px rgba(0,0,0,0.12);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.16);
  --shadow-accent: 0 4px 20px rgba(255,153,52,0.28);

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --header-h:  130px;   /* mobile 2-filas */
  --search-h:   60px;
  --cat-nav-h:  52px;
}

/* ---------- RESET & BASE ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* =====================================================
   HEADER  — Mobile First
   ===================================================== */
.app-header {
  background: linear-gradient(180deg, #FFF8E0 0%, #FFFFFF 100%);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ── Layout base: 2 filas en mobile ── */
.header-inner {
  display: flex;
  flex-wrap: wrap;            /* brand arriba, actions abajo en mobile */
  align-items: center;
  gap: 8px 12px;
  padding: 10px 14px 8px;
  max-width: 1100px;
  margin: 0 auto;
}

/* Brand: fila completa en mobile */
.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 0 100%;            /* full width en mobile */
  min-width: 0;
}

.logo-wrap {
  position: relative;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
  border: 2px solid var(--border-accent);
}

.restaurant-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: linear-gradient(135deg, #FF9934, #B3C631);
}

.brand-info { min-width: 0; flex: 1; }

.brand-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, #FF9934 0%, #CC7A20 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-tagline {
  font-size: 0.6rem;
  color: var(--accent);
  font-weight: 500;
  margin: 1px 0 4px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meta-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.62rem;
  color: var(--text-secondary);
}
.meta-chip svg { flex-shrink: 0; color: var(--accent); }

/* Header Actions: fila completa en mobile (social + lang) */
.header-actions {
  display: flex;
  flex-direction: row;        /* fila en mobile */
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: 1 0 100%;            /* full width en mobile */
}

.social-row {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}

.social-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition), opacity var(--transition), box-shadow var(--transition);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.social-btn svg { width: 14px; height: 14px; }
.social-btn:hover { transform: scale(1.1); }

.social-btn.ig {
  background: linear-gradient(135deg, #405de6, #5851db, #833ab4, #c13584, #e1306c, #fd1d1d);
  color: #fff;
  border-color: transparent;
}
.social-btn.fb {
  background: #1877f2;
  color: #fff;
  border-color: transparent;
}
.social-btn.tk {
  background: #010101;
  color: #fff;
  border-color: transparent;
}
.social-btn.tk:hover { box-shadow: 0 0 12px rgba(1,1,1,0.4); }

.social-btn.x-tw {
  background: #000;
  color: #fff;
  border-color: transparent;
}
.social-btn.x-tw:hover { box-shadow: 0 0 12px rgba(0,0,0,0.4); }

.social-btn.ta {
  background: #34E0A1;
  color: #000;
  border-color: transparent;
}
.social-btn.ta:hover { box-shadow: 0 0 12px rgba(52,224,161,0.5); }

/* Language Toggle */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-accent);
  background: rgba(255,153,52,0.08);
  color: var(--text-primary);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: all var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.lang-toggle:hover {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: var(--shadow-accent);
}
.lang-active { color: var(--accent); }
.lang-divider { color: var(--text-muted); }
.lang-alt { color: var(--text-secondary); }

/* =====================================================
   SEARCH BAR
   ===================================================== */
.search-wrapper {
  position: sticky;
  top: calc(var(--header-h) - 20px);
  z-index: 90;
  padding: 10px 16px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 10px 16px;
  transition: border-color var(--transition), box-shadow var(--transition);
  max-width: 600px;
  margin: 0 auto;
}
.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-icon { color: var(--text-muted); flex-shrink: 0; }

.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 400;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input::-webkit-search-cancel-button { display: none; }

.search-clear {
  color: var(--text-muted);
  padding: 2px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  transition: color var(--transition);
}
.search-clear:hover { color: var(--text-primary); }

/* =====================================================
   FEATURED SECTIONS (HORIZONTAL SCROLL)
   ===================================================== */
.featured-section {
  padding: 24px 0 0;
}

.section-hdr {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 16px;
  margin-bottom: 14px;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.section-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Horizontal Scroll Container */
.h-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 16px 20px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.h-scroll::-webkit-scrollbar { display: none; }

/* Compact Card (Featured) */
.compact-card {
  flex: 0 0 160px;
  scroll-snap-align: start;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
}
.compact-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-md);
  border-color: var(--border-accent);
}
.compact-card:active { transform: scale(0.97); }

.compact-card .cc-img-wrap {
  position: relative;
  height: 110px;
  overflow: hidden;
  background: var(--bg-secondary);
}
.compact-card .cc-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.compact-card:hover .cc-img { transform: scale(1.07); }
.compact-card .cc-img-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  background: linear-gradient(135deg, #FFF0C0, #FFC018);
}

.compact-card .cc-body {
  padding: 10px;
}
.compact-card .cc-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.compact-card .cc-price {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent);
  margin-top: 4px;
}
.compact-card .cc-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
}
.compact-card .cc-stars { font-size: 0.65rem; color: var(--gold); }
.compact-card .cc-rating-val {
  font-size: 0.68rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Badges on compact card */
.card-badges {
  position: absolute;
  top: 7px;
  left: 7px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.3px;
}
.badge-popular {
  background: rgba(255, 153, 52, 0.92);
  color: #fff;
  backdrop-filter: blur(4px);
}
.badge-new {
  background: rgba(179, 198, 49, 0.92);
  color: #fff;
  backdrop-filter: blur(4px);
}

/* =====================================================
   CATEGORY CARDS (visual grid)
   ===================================================== */
.cat-cards-section {
  padding: 28px 0 4px;
}

.cat-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  padding: 0 16px;
}

.cat-card {
  border-radius: var(--radius-lg);
  padding: 18px 10px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), outline var(--transition);
  border: none;
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Brillo sutil en hover */
.cat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition);
}
.cat-card:hover::after  { background: rgba(255,255,255,0.10); }
.cat-card:active::after { background: rgba(255,255,255,0.18); }

.cat-card:hover {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 8px 28px rgba(0,0,0,0.22);
}
.cat-card:active { transform: scale(0.97); }

/* Tarjeta activa: borde blanco interior */
.cat-card.active {
  outline: 3px solid rgba(255,255,255,0.85);
  outline-offset: -4px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.30);
  transform: translateY(-3px);
}

.cat-card-icon {
  font-size: 2rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
}

.cat-card-name {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  text-shadow: 0 1px 6px rgba(0,0,0,0.35);
  letter-spacing: 0.2px;
}

.cat-card-count {
  font-size: 0.62rem;
  font-weight: 600;
  background: rgba(255,255,255,0.22);
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.3px;
  backdrop-filter: blur(4px);
}

/* =====================================================
   CATEGORY NAVIGATION
   ===================================================== */
.cat-nav-sticky {
  position: sticky;
  top: calc(var(--search-h) + 60px);
  z-index: 80;
  background: var(--bg-primary);
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.cat-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px;
  scrollbar-width: none;
}
.cat-nav::-webkit-scrollbar { display: none; }

.cat-btn {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  white-space: nowrap;
  transition: all var(--transition);
  scroll-snap-align: start;
}
.cat-btn:hover {
  color: var(--text-primary);
  border-color: rgba(255,153,52,0.4);
  background: var(--bg-card-hover);
}
.cat-btn.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: var(--shadow-accent);
}
.cat-btn-icon { font-size: 0.85rem; line-height: 1; }

/* Subcategory */
.subcat-nav-wrap {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
}
.subcat-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 16px;
  scrollbar-width: none;
}
.subcat-nav::-webkit-scrollbar { display: none; }
.subcat-btn {
  flex: 0 0 auto;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.73rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  white-space: nowrap;
  transition: all var(--transition);
}
.subcat-btn:hover { color: var(--text-secondary); }
.subcat-btn.active {
  color: var(--accent);
  border-color: var(--border-accent);
  background: var(--accent-glow);
}

/* =====================================================
   PRODUCTS GRID
   ===================================================== */
.products-section {
  padding: 20px 16px 120px;
  max-width: 900px;
  margin: 0 auto;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

/* Full Product Card */
.product-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-accent);
}
.product-card:active { transform: scale(0.97); }

.pc-img-wrap {
  position: relative;
  padding-top: 70%;
  overflow: hidden;
  background: var(--bg-secondary);
}
.pc-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.product-card:hover .pc-img { transform: scale(1.06); }
.pc-img-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  background: linear-gradient(135deg, #FFF0C0, #FFC018);
}

.pc-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 1;
}

.pc-body {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pc-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pc-desc {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.pc-price {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--accent);
}

.pc-rating {
  display: flex;
  align-items: center;
  gap: 3px;
}
.stars { color: var(--gold); font-size: 0.65rem; letter-spacing: 1px; }
.star-empty { color: var(--text-muted); }
.rating-val {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* =====================================================
   PRODUCT DETAIL MODAL
   ===================================================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.2s ease;
}
.modal-overlay.open {
  display: flex;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.modal-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-card::-webkit-scrollbar { display: none; }

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  backdrop-filter: blur(4px);
}
.modal-close:hover { background: rgba(255,153,52,0.9); color: #fff; }

.modal-img-wrap {
  position: relative;
  height: 240px;
  overflow: hidden;
  background: var(--bg-secondary);
}
.modal-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.modal-img-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
  background: linear-gradient(135deg, #FFF0C0, #FFC018);
}

.modal-body { padding: 20px; }

.modal-badges {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.modal-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  margin-bottom: 8px;
}

.modal-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.modal-rating .stars { font-size: 0.85rem; }
.modal-rating .rating-val { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); }

.modal-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.modal-price {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--accent);
}


/* =====================================================
   EMPTY STATE
   ===================================================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-emoji { font-size: 64px; margin-bottom: 16px; }
.empty-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.empty-sub { font-size: 0.85rem; color: var(--text-secondary); }

/* =====================================================
   FOOTER
   ===================================================== */
.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.footer-dev {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.footer-dev a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.footer-dev a:hover {
  text-decoration: underline;
}

.admin-link {
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 600;
  padding: 4px 12px;
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-pill);
  transition: all var(--transition);
}
.admin-link:hover {
  background: var(--accent);
  color: #fff;
}

/* =====================================================
   LOADING SKELETON
   ===================================================== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

/* ── 480px: small phones ── */
@media (min-width: 480px) {
  .cat-cards-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 13px; }
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  }
  .compact-card { flex: 0 0 180px; }

  /* Header: brand name un poco más grande */
  .brand-name    { font-size: 1rem; }
  .brand-tagline { font-size: 0.63rem; }
  .logo-wrap     { width: 46px; height: 46px; }
  .social-btn    { width: 29px; height: 29px; }
}

/* ── 540px: large phone / small tablet — 1 FILA ── */
@media (min-width: 540px) {
  :root { --header-h: 90px; }

  .header-inner {
    flex-wrap: nowrap;           /* 1 sola fila */
    align-items: flex-start;
    padding: 12px 18px 10px;
    gap: 12px;
  }

  /* Brand vuelve a flex-grow */
  .header-brand { flex: 1 1 0; min-width: 0; }

  /* Actions vuelve a columna (social arriba, lang abajo) */
  .header-actions {
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 8px;
  }

  .logo-wrap     { width: 50px; height: 50px; }
  .logo-fallback { font-size: 24px; }
  .brand-name    { font-size: 1.05rem; }
  .brand-tagline { font-size: 0.65rem; margin: 1px 0 5px; }
  .meta-chip     { font-size: 0.65rem; }
  .social-btn    { width: 30px; height: 30px; }
  .social-btn svg{ width: 15px; height: 15px; }
  .social-row    { gap: 7px; }
  .lang-toggle   { font-size: 0.7rem; padding: 4px 11px; }
}

/* ── 768px: tablet ── */
@media (min-width: 768px) {
  :root { --header-h: 100px; }

  .header-inner  { padding: 14px 24px 12px; }
  .logo-wrap     { width: 58px; height: 58px; }
  .logo-fallback { font-size: 28px; }
  .brand-name    { font-size: 1.2rem; }
  .brand-tagline { font-size: 0.7rem; }
  .meta-chip     { font-size: 0.68rem; gap: 5px; }
  .social-btn    { width: 32px; height: 32px; }
  .social-btn svg{ width: 16px; height: 16px; }
  .social-row    { gap: 8px; }
  .lang-toggle   { font-size: 0.72rem; padding: 5px 12px; }

  .cat-cards-grid  { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; padding: 0 24px; }
  .cat-cards-section { padding: 32px 0 8px; }
  .cat-card        { padding: 22px 12px 18px; }
  .cat-card-icon   { font-size: 2.2rem; }
  .cat-card-name   { font-size: 0.82rem; }
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 20px;
  }
  .compact-card { flex: 0 0 200px; }
  .compact-card .cc-img-wrap { height: 130px; }
  .search-wrapper  { padding: 12px 24px; }
  .products-section{ padding: 24px 24px 140px; }
  .h-scroll        { padding: 4px 24px 24px; }
  .cat-nav, .subcat-nav { padding: 0 24px; }
  .section-hdr     { padding: 0 24px; }
}

/* ── 1024px: desktop ── */
@media (min-width: 1024px) {
  :root { --header-h: 108px; }
  .cat-cards-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; padding: 0 32px; }
  .cat-card        { padding: 24px 14px 20px; }
  .cat-card-icon   { font-size: 2.4rem; }
  .cat-card-name   { font-size: 0.85rem; }
  .cat-card-count  { font-size: 0.65rem; }

  .header-inner  {
    padding: 18px 32px 14px;
    max-width: 1100px;
  }
  .logo-wrap     { width: 66px; height: 66px; }
  .logo-fallback { font-size: 32px; }
  .brand-name    { font-size: 1.35rem; letter-spacing: -0.5px; }
  .brand-tagline { font-size: 0.75rem; margin: 2px 0 7px; }
  .meta-chip     { font-size: 0.72rem; gap: 6px; }
  .brand-meta    { gap: 4px; }
  .social-btn    { width: 34px; height: 34px; }
  .social-btn svg{ width: 17px; height: 17px; }
  .social-row    { gap: 9px; }
  .lang-toggle   { font-size: 0.74rem; padding: 5px 14px; }
  .header-actions{ gap: 10px; }

  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}

/* ── 1280px: wide desktop ── */
@media (min-width: 1280px) {
  .header-inner  { padding: 20px 40px 16px; }
  .logo-wrap     { width: 72px; height: 72px; }
  .brand-name    { font-size: 1.45rem; }
  .social-btn    { width: 36px; height: 36px; }
  .social-btn svg{ width: 18px; height: 18px; }
  .social-row    { gap: 10px; }
  .products-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── Modal centrado en tablet+ ── */
@media (min-width: 768px) {
  .modal-overlay  { align-items: center; }
  .modal-card     { border-radius: var(--radius-xl); max-height: 85vh; }
  .modal-img-wrap { height: 280px; }
}

/* =====================================================
   SCROLLBAR GLOBAL
   ===================================================== */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* =====================================================
   UTILITIES
   ===================================================== */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* =====================================================
   TAX NOTE
   ===================================================== */
.tax-note {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 7px 16px;
  border-bottom: 1px solid var(--border);
}
.tax-note--included {
  color: #3a7d44;
  background: #f0faf2;
}
.tax-note--excluded {
  color: #92400e;
  background: #fffbeb;
  border-color: #fde68a;
}

/* =====================================================
   PROMO POPUP
   ===================================================== */
.promo-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.25s ease;
}
.promo-overlay.open { display: flex; }

.promo-card {
  position: relative;
  background: #fff;
  border-radius: 24px;
  width: 100%;
  max-width: 420px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: slideUp 0.3s cubic-bezier(0.4,0,0.2,1);
}

.promo-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.08);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  color: #333;
}
.promo-close:hover { background: rgba(0,0,0,0.16); }

.promo-img-wrap { display: none; }
.promo-img-wrap.has-img { display: block; }
.promo-img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 24px 24px 0 0;
  display: block;
}

.promo-body {
  padding: 24px 24px 28px;
}
.promo-titulo {
  font-size: 1.25rem;
  font-weight: 800;
  color: #212121;
  margin-bottom: 10px;
  line-height: 1.3;
}
.promo-texto {
  font-size: 0.92rem;
  color: #555;
  line-height: 1.6;
  margin-bottom: 18px;
  white-space: pre-wrap;
}
.promo-btn-cta {
  display: none;
  width: 100%;
  text-align: center;
  padding: 13px 24px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
  box-sizing: border-box;
}
.promo-btn-cta.visible { display: block; }
.promo-btn-cta:hover { opacity: 0.88; transform: translateY(-1px); }
