/**
 * =============================================================================
 * ALTO CERRO — Menú Digital
 * styles.css — Estilos globales + Sistema de administración
 * =============================================================================
 *
 * TABLA DE CONTENIDOS
 * ─────────────────────────────────────────────────────────────────────────────
 *  1.  Variables CSS (Design Tokens)
 *  2.  Reset & Base
 *  3.  Scrollbar personalizado
 *  4.  Header / Barra superior
 *  5.  Hero
 *  6.  Navegación de categorías (sticky)
 *  7.  Contenido principal
 *  8.  Secciones del menú
 *  9.  Grid de platos
 * 10.  Tarjeta de plato (card)
 * 11.  Resultados de búsqueda
 * 12.  Modal de detalle (visitante)
 * 13.  Footer
 * 14.  ── ADMIN ── Barra de estado admin
 * 15.  ── ADMIN ── Botón flotante (FAB)
 * 16.  ── ADMIN ── Modal de login
 * 17.  ── ADMIN ── Controles en tarjetas y secciones
 * 18.  ── ADMIN ── Formulario de plato
 * 19.  ── ADMIN ── Formulario de categoría
 * 20.  ── ADMIN ── Botones de acción dentro de secciones
 * 21.  Notificaciones toast
 * 22.  Animaciones (@keyframes)
 * 23.  Responsive / Media queries
 * =============================================================================
 */


/* =============================================================================
   1. VARIABLES CSS
   ============================================================================= */
:root {
  --bg:          #0d0d0b;
  --card:        #141410;
  --card2:       #1a1a15;
  --border:      rgba(255,255,255,0.08);
  --primary:     #c9a96e;
  --primary-dim: rgba(201,169,110,0.15);
  --fg:          #f0ece4;
  --muted:       #7a7468;
  --secondary:   rgba(255,255,255,0.06);
  --danger:      #e05555;
  --success:     #4caf7d;

  /* Formularios admin */
  --form-bg:     #1e1e18;
  --form-input:  #252520;
  --form-border: rgba(255,255,255,0.12);
}


/* =============================================================================
   2. RESET & BASE
   ============================================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { scroll-behavior: smooth; }
body  { background: var(--bg); color: var(--fg); font-family: 'DM Sans', sans-serif; min-height: 100vh; line-height: 1.6; }
svg   { display: inline-block; vertical-align: middle; }


/* =============================================================================
   3. SCROLLBAR
   ============================================================================= */
::-webkit-scrollbar       { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }


/* =============================================================================
   4. HEADER
   ============================================================================= */
header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: background 0.4s ease, padding 0.4s ease, box-shadow 0.4s ease;
  padding: 14px 0;
  /* Siempre visible en móvil — fondo semitransparente permanente */
  background: rgba(13,13,11,0.92);
  backdrop-filter: blur(12px);
}
header.scrolled {
  background: rgba(13,13,11,0.98);
  padding: 10px 0;
  box-shadow: 0 4px 30px rgba(0,0,0,0.6);
}
/* En escritorio el header arranca transparente sobre el hero */
@media (min-width: 768px) {
  header {
    background: transparent;
    backdrop-filter: none;
    padding: 20px 0;
  }
  header.scrolled {
    background: rgba(13,13,11,0.95);
    backdrop-filter: blur(12px);
    padding: 12px 0;
    box-shadow: 0 4px 30px rgba(0,0,0,0.5);
  }
}

.header-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Logo */
.logo-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.35rem; font-weight: 700;
  letter-spacing: 0.08em; line-height: 1.1;
  white-space: nowrap;
}
.logo-text span { color: var(--primary); }
.logo-sub  { font-size: 0.58rem; color: var(--muted); letter-spacing: 0.2em; text-transform: uppercase; margin-top: 2px; }

/* En escritorio el logo puede ser más grande */
@media (min-width: 768px) {
  .logo-text { font-size: 1.6rem; }
  .logo-sub  { font-size: 0.62rem; letter-spacing: 0.25em; }
  .header-inner { padding: 0 24px; }
}

/* Contacto — oculto en móvil, visible en escritorio (y se oculta al scrollear) */
.header-contact {
  display: none; /* oculto en móvil */
}
@media (min-width: 768px) {
  .header-contact {
    display: flex; align-items: center; gap: 24px;
    justify-content: center; margin-top: 10px;
    font-size: 0.72rem; color: var(--muted);
    transition: all 0.3s ease;
  }
  header.scrolled .header-contact {
    opacity: 0; height: 0; margin: 0; overflow: hidden; pointer-events: none;
  }
}
.header-contact a { color: var(--muted); text-decoration: none; display: flex; align-items: center; gap: 5px; transition: color 0.2s; }
.header-contact a:hover { color: var(--primary); }

/* Botón admin en el header */
.admin-header-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 10px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--secondary); color: var(--muted);
  font-family: 'DM Sans', sans-serif; font-size: 0.75rem;
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
/* En móvil solo muestra el ícono, sin texto */
.admin-header-btn .btn-text { display: none; }
@media (min-width: 480px) {
  .admin-header-btn { padding: 7px 14px; font-size: 0.78rem; }
  .admin-header-btn .btn-text { display: inline; }
}
.admin-header-btn:hover     { border-color: var(--primary); color: var(--primary); }
#admin-logout-btn           { display: none; border-color: rgba(224,85,85,0.3); color: var(--danger); }
#admin-logout-btn:hover     { background: rgba(224,85,85,0.1); }

/* Buscador */
.search-btn { background: var(--secondary); border: none; color: var(--fg); width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; }
.search-btn:hover { background: rgba(255,255,255,0.12); transform: scale(1.05); }
.search-wrap { display: flex; align-items: center; gap: 8px; }
.search-input-wrap { position: relative; display: none; }
.search-input-wrap.open { display: flex; align-items: center; }
.search-input-wrap input { background: var(--secondary); border: 1px solid var(--border); color: var(--fg); border-radius: 20px; padding: 8px 16px 8px 38px; font-family: 'DM Sans', sans-serif; font-size: 0.875rem; width: 220px; outline: none; transition: border-color 0.2s; }
.search-input-wrap input:focus { border-color: var(--primary); }
.search-input-wrap input::placeholder { color: var(--muted); }
.search-icon-left { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-close { background: none; border: none; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.search-close:hover { background: var(--secondary); color: var(--fg); }


/* =============================================================================
   5. HERO
   ============================================================================= */
.hero { position: relative; height: 60vh; min-height: 400px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background-image: url('https://cdn.deliway.com.br/blog/base/1bf/0c5/923/900-473-comidas-arabe.jpg'); background-size: cover; background-position: center; }
.hero-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(13,13,11,0.75) 0%, rgba(13,13,11,0.45) 50%, #0d0d0b 100%); }
.hero-content { position: relative; z-index: 1; text-align: center; padding: 0 24px; }
.hero-badge  { display: inline-block; padding: 6px 18px; font-size: 0.68rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--primary); border: 1px solid rgba(201,169,110,0.3); border-radius: 50px; margin-bottom: 24px; animation: fadeUp 0.7s ease both; }
.hero-title  { font-family: 'Cormorant Garamond', serif; font-size: clamp(2.4rem, 6vw, 5rem); font-weight: 700; line-height: 1.1; margin-bottom: 16px; animation: fadeUp 0.7s 0.15s ease both; }
.hero-title em { font-style: italic; color: var(--primary); }
.hero-sub    { color: var(--muted); font-size: 1rem; max-width: 500px; margin: 0 auto 32px; animation: fadeUp 0.7s 0.3s ease both; }
.hero-cta    { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; background: none; border: none; color: var(--muted); font-family: 'DM Sans', sans-serif; font-size: 0.85rem; animation: fadeUp 0.7s 0.45s ease both; transition: color 0.2s; }
.hero-cta:hover { color: var(--primary); }
.bounce { animation: bounce 1.5s ease-in-out infinite; display: block; }


/* =============================================================================
   6. NAVEGACIÓN DE CATEGORÍAS
   ============================================================================= */
#menu-categories { position: sticky; top: 62px; z-index: 40; background: rgba(13,13,11,0.95); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.cat-nav-inner   { display: flex; gap: 8px; overflow-x: auto; padding: 14px 20px; scrollbar-width: none; max-width: 1200px; margin: 0 auto; }
.cat-nav-inner::-webkit-scrollbar { display: none; }
.cat-btn { display: flex; align-items: center; gap: 7px; padding: 9px 18px; border-radius: 50px; font-family: 'DM Sans', sans-serif; font-size: 0.82rem; font-weight: 500; white-space: nowrap; cursor: pointer; border: 1px solid transparent; background: var(--secondary); color: var(--muted); transition: all 0.3s ease; }
.cat-btn:hover  { background: rgba(255,255,255,0.1); color: var(--fg); }
.cat-btn.active { background: var(--primary); color: #0d0d0b; box-shadow: 0 4px 20px rgba(201,169,110,0.3); transform: scale(1.04); }
.cat-icon { font-size: 1rem; }


/* =============================================================================
   7. CONTENIDO PRINCIPAL
   ============================================================================= */
main { max-width: 1200px; margin: 0 auto; padding: 0 20px 60px; }


/* =============================================================================
   8. SECCIONES DEL MENÚ
   ============================================================================= */
.menu-section { padding: 60px 0 20px; }
.section-header { display: flex; align-items: center; gap: 16px; margin-bottom: 32px; }
.section-icon  { font-size: 1.8rem; }
.section-title { font-family: 'Cormorant Garamond', serif; font-size: 1.9rem; font-weight: 700; }
.section-line  { flex: 1; height: 1px; background: linear-gradient(to right, var(--border), transparent); }


/* =============================================================================
   9. GRID DE PLATOS
   ============================================================================= */
.items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px; }


/* =============================================================================
   10. TARJETA DE PLATO
   ============================================================================= */
.item-card { background: var(--card); border-radius: 16px; overflow: hidden; cursor: pointer; border: 1px solid var(--border); transition: all 0.4s ease; opacity: 0; animation: fadeUp 0.5s ease forwards; }
.item-card:hover { border-color: rgba(201,169,110,0.3); transform: translateY(-4px); box-shadow: 0 20px 40px rgba(0,0,0,0.4), 0 0 0 1px rgba(201,169,110,0.1); }
/* En admin el cursor es default (no se abre el modal) */
.item-card.admin-mode { cursor: default; }
.item-card.admin-mode:hover { transform: none; box-shadow: 0 0 0 2px rgba(201,169,110,0.25); }

.card-img-wrap { position: relative; aspect-ratio: 4/3; overflow: hidden; background: var(--secondary); }
.card-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; display: block; }
.item-card:not(.admin-mode):hover .card-img-wrap img { transform: scale(1.08); }
.card-img-overlay { position: absolute; inset: 0; background: linear-gradient(to top, var(--card) 0%, rgba(20,20,16,0.1) 60%, transparent 100%); opacity: 0.65; }

.featured-badge { position: absolute; top: 12px; left: 12px; display: flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 50px; background: rgba(201,169,110,0.9); font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #1a1408; }

.quick-add { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; background: rgba(13,13,11,0.8); border: none; color: var(--fg); display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; transition: all 0.3s ease; }
.item-card:hover .quick-add { opacity: 1; }
.quick-add:hover { background: var(--primary); color: #1a1408; transform: scale(1.1); }

.card-body  { padding: 16px; }
.card-tags  { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.tag        { padding: 2px 9px; border-radius: 50px; font-size: 0.62rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; background: var(--secondary); color: var(--muted); }
.card-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.card-name  { font-family: 'Cormorant Garamond', serif; font-size: 1.15rem; font-weight: 600; line-height: 1.25; transition: color 0.2s; }
.item-card:not(.admin-mode):hover .card-name { color: var(--primary); }
.card-price { color: var(--primary); font-weight: 600; font-size: 0.9rem; white-space: nowrap; }
.card-desc  { font-size: 0.8rem; color: var(--muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-accent { height: 2px; background: linear-gradient(to right, transparent, var(--primary), transparent); opacity: 0; transition: opacity 0.4s; }
.item-card:not(.admin-mode):hover .card-accent { opacity: 1; }


/* =============================================================================
   11. RESULTADOS DE BÚSQUEDA
   ============================================================================= */
.search-results { padding: 40px 0; }
.search-heading { font-family: 'Cormorant Garamond', serif; font-size: 1.4rem; font-weight: 600; margin-bottom: 24px; color: var(--muted); }
.search-heading span { color: var(--primary); }
.no-results { text-align: center; padding: 60px 20px; color: var(--muted); }
.no-results p { font-size: 1.1rem; margin-top: 12px; }


/* =============================================================================
   12. MODAL DE DETALLE (visitante)
   ============================================================================= */
.modal-overlay  { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(6px); }
.modal-box      { position: relative; z-index: 1; width: 100%; max-width: 520px; background: var(--card2); border: 1px solid var(--border); border-radius: 28px 28px 0 0; max-height: 92vh; overflow: hidden; display: flex; flex-direction: column; transform: translateY(60px); transition: transform 0.35s cubic-bezier(0.34, 1.4, 0.64, 1); }
.modal-overlay.open .modal-box { transform: translateY(0); }
@media (min-width: 640px) { .modal-overlay { align-items: center; } .modal-box { border-radius: 24px; margin: 0 16px; } }
.modal-close    { position: absolute; top: 14px; right: 14px; z-index: 10; width: 36px; height: 36px; border-radius: 50%; background: rgba(13,13,11,0.8); border: none; color: var(--fg); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.modal-close:hover { background: var(--bg); }
.modal-img      { position: relative; aspect-ratio: 16/10; flex-shrink: 0; background: var(--secondary); overflow: hidden; }
.modal-img img  { width: 100%; height: 100%; object-fit: cover; display: block; }
.modal-img-overlay  { position: absolute; inset: 0; background: linear-gradient(to top, var(--card2) 0%, transparent 60%); }
.modal-feat-badge   { position: absolute; bottom: 14px; left: 14px; display: flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 50px; background: rgba(201,169,110,0.9); font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #1a1408; }
.modal-body     { padding: 24px; overflow-y: auto; flex: 1; }
.modal-tags     { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.modal-name     { font-family: 'Cormorant Garamond', serif; font-size: 1.8rem; font-weight: 700; margin-bottom: 4px; }
.modal-price    { font-size: 1.5rem; font-weight: 700; color: var(--primary); margin-bottom: 14px; }
.modal-desc     { color: var(--muted); font-size: 0.9rem; line-height: 1.6; margin-bottom: 20px; }
.qty-row        { display: flex; align-items: center; justify-content: space-between; padding-top: 20px; border-top: 1px solid var(--border); }
.qty-label      { font-size: 0.85rem; color: var(--muted); }
.qty-controls   { display: flex; align-items: center; gap: 16px; }
.qty-btn        { width: 36px; height: 36px; border-radius: 50%; background: var(--secondary); border: 1px solid var(--border); color: var(--fg); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; font-size: 1rem; }
.qty-btn:hover:not(:disabled) { background: rgba(255,255,255,0.12); }
.qty-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.qty-num        { font-size: 1.2rem; font-weight: 700; min-width: 28px; text-align: center; }
.modal-footer   { padding: 16px 24px; border-top: 1px solid var(--border); background: var(--card2); }
.add-btn        { width: 100%; padding: 16px 20px; border-radius: 14px; border: none; background: var(--primary); color: #1a1408; font-family: 'DM Sans', sans-serif; font-size: 1rem; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: space-between; transition: all 0.2s; }
.add-btn:hover  { background: #d4b27a; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(201,169,110,0.35); }
.add-btn .btn-left { display: flex; align-items: center; gap: 10px; }


/* =============================================================================
   13. FOOTER
   ============================================================================= */
footer { background: var(--card); border-top: 1px solid var(--border); padding: 56px 20px; }
.footer-inner { max-width: 1000px; margin: 0 auto; }
.footer-logo  { font-family: 'Cormorant Garamond', serif; font-size: 1.6rem; font-weight: 700; text-align: center; margin-bottom: 6px; }
.footer-logo span { color: var(--primary); }
.footer-sub   { text-align: center; font-size: 0.68rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); margin-bottom: 40px; }
.footer-grid  { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 32px; margin-bottom: 36px; text-align: center; }
.footer-block h3 { font-size: 0.9rem; font-weight: 600; margin-bottom: 6px; }
.footer-block p, .footer-block a { font-size: 0.82rem; color: var(--muted); text-decoration: none; line-height: 1.6; display: block; }
.footer-block a:hover { color: var(--primary); }
.footer-icon-wrap { width: 44px; height: 44px; border-radius: 50%; background: var(--secondary); display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; font-size: 1.1rem; }
.wifi-pill    { display: flex; align-items: center; gap: 8px; justify-content: center; padding: 10px 20px; background: var(--secondary); border-radius: 50px; font-size: 0.8rem; color: var(--muted); max-width: 220px; margin: 0 auto 32px; }
.wifi-pill strong { color: var(--fg); }
.social-row   { display: flex; justify-content: center; gap: 12px; margin-bottom: 36px; }
.social-btn   { width: 44px; height: 44px; border-radius: 50%; background: var(--secondary); border: none; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1rem; transition: all 0.3s; text-decoration: none; }
.social-btn:hover { background: var(--primary); color: #1a1408; }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 24px; text-align: center; font-size: 0.72rem; color: var(--muted); }


/* =============================================================================
   14. ADMIN — Barra de estado
   Banda dorada fija en la parte superior que indica modo admin activo.
   ============================================================================= */
#admin-bar {
  display: none;                      /* JS la muestra al hacer login  */
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  background: linear-gradient(90deg, #1a1408, #2a1f0a, #1a1408);
  border-bottom: 1px solid rgba(201,169,110,0.4);
  padding: 6px 20px;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--primary);
  letter-spacing: 0.05em;
}
#admin-bar .bar-label { display: flex; align-items: center; gap: 8px; font-weight: 600; }

/* Cuando la barra está visible, el header baja para no solaparse */
body.admin-active header { top: 34px; }
body.admin-active #menu-categories { top: calc(68px + 34px); }


/* =============================================================================
   15. ADMIN — Botón flotante (FAB)
   Botón circular fijo en la esquina inferior derecha para abrir el login.
   Solo visible en modo visitante.
   ============================================================================= */
#admin-fab {
  position: fixed;
  bottom: 28px; right: 28px;
  z-index: 90;
  width: 50px; height: 50px;
  border-radius: 50%;
  background: var(--card2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 1.2rem;
  display: flex;
  align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  transition: all 0.3s;
}
#admin-fab:hover { border-color: var(--primary); color: var(--primary); transform: scale(1.08); }


/* =============================================================================
   16. ADMIN — Modal de login
   ============================================================================= */
#login-modal { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
#login-modal.open { opacity: 1; pointer-events: all; }
.login-backdrop   { position: absolute; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(8px); }
.login-box        {
  position: relative; z-index: 1;
  width: 100%; max-width: 380px; margin: 0 20px;
  background: var(--form-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 32px;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
}
#login-modal.open .login-box { transform: scale(1); }

.login-icon    { font-size: 2.2rem; text-align: center; margin-bottom: 12px; }
.login-title   { font-family: 'Cormorant Garamond', serif; font-size: 1.5rem; font-weight: 700; text-align: center; margin-bottom: 4px; }
.login-sub     { font-size: 0.8rem; color: var(--muted); text-align: center; margin-bottom: 24px; }
.login-close   { position: absolute; top: 14px; right: 14px; background: none; border: none; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.login-close:hover { background: var(--secondary); color: var(--fg); }

/* Campo de contraseña */
.login-field   { position: relative; }
.login-field input {
  width: 100%; padding: 12px 16px;
  background: var(--form-input);
  border: 1px solid var(--form-border);
  border-radius: 10px;
  color: var(--fg);
  font-family: 'DM Sans', sans-serif; font-size: 0.95rem;
  outline: none; transition: border-color 0.2s;
  letter-spacing: 0.15em;
}
.login-field input:focus { border-color: var(--primary); }
.login-field input::placeholder { letter-spacing: normal; color: var(--muted); }

/* Mensaje de error con animación shake */
.login-error {
  display: none;
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 10px;
  text-align: center;
  padding: 8px 12px;
  background: rgba(224,85,85,0.08);
  border-radius: 8px;
  border: 1px solid rgba(224,85,85,0.2);
}
.login-error.shake { animation: shake 0.4s ease; }

/* Botón de ingresar */
.login-btn {
  width: 100%; margin-top: 20px;
  padding: 13px; border-radius: 10px; border: none;
  background: var(--primary); color: #1a1408;
  font-family: 'DM Sans', sans-serif; font-size: 0.95rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.login-btn:hover { background: #d4b27a; transform: translateY(-1px); }


/* =============================================================================
   17. ADMIN — Controles en tarjetas y cabeceras de sección
   ============================================================================= */

/* Botones ✏️ 🗑️ superpuestos sobre la imagen de la tarjeta */
.card-admin-controls {
  position: absolute; top: 10px; right: 10px;
  display: flex; gap: 6px;
  opacity: 0;
  transition: opacity 0.25s;
}
.item-card:hover .card-admin-controls { opacity: 1; }

.card-admin-btn {
  width: 32px; height: 32px; border-radius: 50%; border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 0.85rem; transition: all 0.2s;
  backdrop-filter: blur(6px);
}
.card-admin-btn.edit-btn   { background: rgba(30,30,24,0.85); }
.card-admin-btn.delete-btn { background: rgba(30,30,24,0.85); }
.card-admin-btn.edit-btn:hover   { background: var(--primary); transform: scale(1.1); }
.card-admin-btn.delete-btn:hover { background: var(--danger);  transform: scale(1.1); }

/* Botones ✏️ 🗑️ en la cabecera de cada sección */
.section-admin-btn {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--secondary); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 0.85rem; transition: all 0.2s;
}
.section-admin-btn.edit:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-dim); }
.section-admin-btn.del:hover  { border-color: var(--danger);  color: var(--danger);  background: rgba(224,85,85,0.08); }


/* =============================================================================
   18. ADMIN — Formulario de plato (modal)
   ============================================================================= */
.form-modal          { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.form-modal.open     { opacity: 1; pointer-events: all; }
.form-backdrop       { position: absolute; inset: 0; background: rgba(0,0,0,0.75); backdrop-filter: blur(6px); }
.form-box            {
  position: relative; z-index: 1;
  width: 100%; max-width: 540px; margin: 0 16px;
  background: var(--form-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  max-height: 92vh; overflow-y: auto;
  transform: translateY(20px) scale(0.98);
  transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.form-modal.open .form-box { transform: translateY(0) scale(1); }

.form-header         { padding: 24px 28px 0; display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.form-title          { font-family: 'Cormorant Garamond', serif; font-size: 1.4rem; font-weight: 700; }
.form-close          { width: 32px; height: 32px; border-radius: 50%; background: var(--secondary); border: none; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.form-close:hover    { background: rgba(255,255,255,0.12); color: var(--fg); }

.form-body           { padding: 0 28px 8px; }
.form-group          { margin-bottom: 16px; }
.form-label          { display: block; font-size: 0.78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.form-input, .form-textarea, .form-select {
  width: 100%; padding: 11px 14px;
  background: var(--form-input);
  border: 1px solid var(--form-border);
  border-radius: 10px;
  color: var(--fg);
  font-family: 'DM Sans', sans-serif; font-size: 0.9rem;
  outline: none; transition: border-color 0.2s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--primary); }
.form-input::placeholder, .form-textarea::placeholder { color: var(--muted); }
.form-textarea       { resize: vertical; min-height: 80px; line-height: 1.5; }
.form-select         { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a7468' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.form-select option  { background: #1e1e18; color: var(--fg); }
.form-hint           { font-size: 0.72rem; color: var(--muted); margin-top: 5px; }
.form-row            { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Previsualización de imagen */
#item-image-preview  { display: none; width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; margin-top: 10px; border: 1px solid var(--form-border); }

/* Checkbox de "Destacado" */
.form-check          { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.form-check input    { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.form-check-label    { font-size: 0.88rem; color: var(--fg); }

/* Pie del formulario con botones */
.form-footer         { padding: 16px 28px 24px; display: flex; gap: 10px; justify-content: flex-end; border-top: 1px solid var(--border); margin-top: 8px; }
.btn-cancel          { padding: 10px 20px; border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--muted); font-family: 'DM Sans', sans-serif; font-size: 0.9rem; cursor: pointer; transition: all 0.2s; }
.btn-cancel:hover    { background: var(--secondary); color: var(--fg); }
.btn-save            { padding: 10px 24px; border-radius: 10px; border: none; background: var(--primary); color: #1a1408; font-family: 'DM Sans', sans-serif; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn-save:hover      { background: #d4b27a; transform: translateY(-1px); }


/* =============================================================================
   19. ADMIN — Formulario de categoría (modal)
   Reutiliza los estilos de .form-modal / .form-box / etc.
   Solo difiere en el max-width ya que tiene menos campos.
   ============================================================================= */
#cat-form-modal .form-box { max-width: 400px; }


/* =============================================================================
   20. ADMIN — Botones de acción dentro de secciones
   ============================================================================= */

/* Botón "+ Agregar plato" al pie de cada sección */
.add-item-btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; margin-top: 20px;
  padding: 14px;
  border: 1px dashed rgba(201,169,110,0.3);
  border-radius: 14px;
  background: var(--primary-dim);
  color: var(--primary);
  font-family: 'DM Sans', sans-serif; font-size: 0.88rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  letter-spacing: 0.03em;
}
.add-item-btn:hover { background: rgba(201,169,110,0.22); border-style: solid; }

/* Botón "+ Nueva categoría" al final del listado */
.new-category-wrap  { padding: 40px 0 20px; text-align: center; }
.new-category-btn   {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 32px;
  border: 1px dashed rgba(201,169,110,0.3);
  border-radius: 50px;
  background: transparent; color: var(--primary);
  font-family: 'DM Sans', sans-serif; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: all 0.3s;
}
.new-category-btn:hover { background: var(--primary-dim); border-style: solid; }


/* =============================================================================
   21. NOTIFICACIONES TOAST
   Aparecen en la esquina inferior derecha y desaparecen solos.
   ============================================================================= */
#toast-container {
  position: fixed;
  bottom: 28px; right: 28px;
  z-index: 500;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 0.85rem; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  opacity: 0; transform: translateX(20px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: all;
  min-width: 220px;
}
.toast-visible          { opacity: 1; transform: translateX(0); }
.toast-success          { background: #0e2018; border: 1px solid rgba(76,175,125,0.3); color: #6ee0a0; }
.toast-error            { background: #200e0e; border: 1px solid rgba(224,85,85,0.3);  color: #f08080; }
.toast-icon             { font-size: 1rem; flex-shrink: 0; }


/* =============================================================================
   22. ANIMACIONES
   ============================================================================= */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(6px); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}


/* =============================================================================
   23. RESPONSIVE
   ============================================================================= */
@media (max-width: 480px) {
  .items-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card-name  { font-size: 0.95rem; }
  .card-price { font-size: 0.8rem; }
  .card-body  { padding: 10px; }
  .form-row   { grid-template-columns: 1fr; }
  #admin-fab  { bottom: 16px; right: 16px; width: 44px; height: 44px; }
}
@media (max-width: 360px) {
  .items-grid { grid-template-columns: 1fr; }
}

/* =============================================================================
   CORRECCIONES MÓVIL — Parche aplicado
   Soluciona: header invisible, solapamiento logo/acciones, nav sticky offset
   ============================================================================= */

/* Nav sticky: ajuste fino de offset según tamaño de header */
@media (min-width: 768px) {
  #menu-categories { top: 68px; }
}

/* Hero: padding-top en móvil para que el contenido no quede detrás del header */
@media (max-width: 767px) {
  .hero {
    padding-top: 62px;      /* empuja el contenido debajo del header fijo */
    min-height: 480px;
  }
  /* El título ocupa menos espacio en móvil */
  .hero-title { font-size: clamp(1.9rem, 8vw, 3rem); }
  .hero-sub   { font-size: 0.88rem; }
  /* Oculta el subtítulo de búsqueda en pantallas muy estrechas */
  .logo-sub   { display: none; }
}

/* Barra admin: ajusta offset del header cuando está activa */
body.admin-active header            { top: 34px; }
body.admin-active #menu-categories  { top: calc(62px + 34px); }
@media (min-width: 768px) {
  body.admin-active #menu-categories { top: calc(68px + 34px); }
}

/* Botón de búsqueda en móvil: un poco más compacto */
@media (max-width: 400px) {
  .search-input-wrap input { width: 160px; }
  .admin-header-btn        { padding: 7px 8px; }
}
