/* ==========================================================================
   TOKENS — Paleta Saborator (marrón, blanco y amarillo)
   --------------------------------------------------------------------------
   ÚNICO lugar donde se definen colores. Ningún otro archivo (CSS, vistas o
   scripts) debe contener hex, rgb(), hsl() ni nombres de color: todo debe
   referenciar estos tokens.
   Tema claro por defecto. Tema oscuro con <html data-theme="dark">.
   ========================================================================== */

:root {
  --panel-dark:   #6B4226;                 /* Paneles que en oscuro son casi negros: en claro usan el café de marca */
  /* ── Paleta Sabor Casero (úsala por nombre) ── */
  --hueso:          #FBF7EE;   /* fondo principal                   */
  --crema:          #F5EFEB;   /* secciones alternas                */
  --beige:          #E8DFD0;   /* bordes y detalles                 */
  --amarillo-suave: #FFC857;   /* acentos y hover                   */
  --amarillo:       #F4A817;   /* botones principales               */
  --marron:         #6B4226;   /* header, footer, títulos           */
  --marron-oscuro:  #2C1B14;   /* texto principal                   */
  --blanco:         #FFFFFF;   /* tarjetas y texto sobre marrón     */

  /* ── Marca ─────────────────────────────────────────────────────────── */
  --brand:        #6B4226;                 /* Marrón: botones y rellenos         */
  --brand-hover:  #55341E;                 /* Hover del botón principal          */
  --ink:          #6B4226;                 /* Marrón para texto, enlaces, bordes */
  --brand-soft:   rgba(107, 66, 38,.10);     /* Fondos suaves y resaltados         */
  --on-brand:     #FFFFFF;                 /* Texto sobre marrón                 */
  --gold:         #F4A817;                 /* Amarillo de acento                 */

  /* ── Fondos y texto (Paleta Crema / Beige Saborator) ─────────── */
  --bg:           #FBF7EE;                 /* Crema: fondo de página             */
  --surface:      #FFFFFF;                 /* Tarjetas y superficies claras      */
  --surface-2:    #F5EFEB;                 /* Beige cálido para elementos crema  */
  --cream:        #F5EFEB;                 /* Crema base                         */
  --cream-light:  #FFFFFF;                 /* Crema marfil / lino                */
  --cream-deep:   #F1E9DC;                 /* Beige cálido / arena               */
  --cream-border: #E8DFD0;                 /* Borde beige suave                  */
  --cream-line:   #DDD0BC;                 /* Borde beige estructurado           */
  --cream-chip:   #F5EFEB;                 /* Fondo para pastillas y badges crema*/
  --text:         #2C1B14;                 /* Texto principal                    */
  --muted:        #6E5D53;                 /* Texto secundario                   */
  --faint:        #7B6A5F;                 /* Pistas y texto tenue (>= 4,5:1)    */
  --line:         #E8DFD0;                 /* Bordes                             */
  --line-2:       #DDD0BC;                 /* Bordes más marcados                */

  /* ── Botón principal (CTA), héroe y barra flotante ── */
  --cta:            #F4A817;                 /* Amarillo mostaza cálido            */
  --cta-ink:        #2C1B14;                 /* Texto sobre el CTA                 */
  --cta-glow:       0 6px 18px rgba(244, 168, 23, .35);
  --hero-glow-start: #3B2217;                /* Foco de luz del héroe              */
  --hero-glow-end:   #1B0F0A;                /* Bordes del héroe (espresso)        */
  --bar-bg:         rgba(44, 27, 20, .88);   /* Barra flotante de pedido (cristal) */

  /* ── Estados ───────────────────────────────────────────────────────── */
  --success:      #2A7348;                 /* Pagado o aprobado                  */
  --success-bg:   #E3F1E8;
  --amber:        #F4A817;                 /* Amarillo ámbar (avisos y acentos)  */
  --warning:      #F4A817;
  --amber-ink:    #7A5200;                 /* Texto de aviso legible             */
  --amber-bg:     rgba(244, 201, 93,.18);
  --danger:       #D6453D;                 /* Errores (relleno)                  */
  --danger-ink:   #B3322B;                 /* Texto de error                     */
  --danger-bg:    #FBE4E2;                 /* Fondo de error                     */
  --info:         #2563EB;                 /* Informativo                        */

  /* ── Curvas de aceleración precisas (Emil Kowalski Design Engineering) ───── */
  --ease:         cubic-bezier(0.23, 1, 0.32, 1);       /* Strong ease-out (UI instant feedback) */
  --ease-out:     cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out:  cubic-bezier(0.77, 0, 0.175, 1);     /* Smooth morphing */
  --ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);    /* Subtle spring for badges/toggles */
  --ease-drawer:  cubic-bezier(0.32, 0.72, 0, 1);       /* iOS-style sheet curve */

  /* ── Sombras multicapa (ambient + directional + inner bevel) ── */
  --shadow-sm:    0 1px 2px rgba(62, 38, 21, 0.04), 0 1px 3px rgba(62, 38, 21, 0.05);
  --shadow:       0 2px 4px rgba(62, 38, 21, 0.04), 0 8px 24px -6px rgba(62, 38, 21, 0.08);
  --shadow-md:    0 4px 8px rgba(62, 38, 21, 0.04), 0 14px 32px -8px rgba(62, 38, 21, 0.12);
  --shadow-lg:    0 8px 16px rgba(62, 38, 21, 0.05), 0 24px 52px -12px rgba(62, 38, 21, 0.16);
  --shadow-inner: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  --shadow-soft:  0 1px 2px rgba(62, 38, 21, 0.04);
  --overlay:      rgba(24, 16, 18, 0.55);

  /* ── Jerarquía de radios armónicos (R_inner = R_outer - padding) ── */
  --r-control:    10px;
  --r-card:       16px;
  --r-block:      16px;
  --r-inner:      8px;

  /* ── Tipografía refinada ───────────────────────────────────── */
  --font-ui:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  --font-mono:    'Inter', system-ui, sans-serif;
  --font-serif:   'Bebas Neue', 'Inter', system-ui, sans-serif;

  /* Colores de avatares */
  --avatar-1: #3B5B7A;
  --avatar-2: #5B3F6B;
  --avatar-3: #8A6A2F;
  --avatar-4: #55341E;
  --avatar-5: #4F5D3A;
  --avatar-6: #7A4B5A;
}

:root[data-theme="dark"],
:root[data-theme="noche"] {
  --panel-dark:   #1E120C;
  --brand:        #8B5A36;
  --brand-hover:  #A56E43;
  --ink:          #FFBF3F;
  --brand-soft:   rgba(244, 201, 93,.16);
  --on-brand:     #FFFFFF;
  --gold:         #FFBF3F;

  --bg:           #24150E;
  --surface:      #2E1B12;
  --surface-2:    #35241A;
  --cream:        #2E1B12;
  --cream-light:  #35241A;
  --cream-deep:   #3B2A20;
  --cream-border: #352821;
  --cream-line:   #44342B;
  --cream-chip:   #35241A;
  --text:         #FFFBF5;
  --muted:        #C4B5A5;
  --faint:        #A09080;
  --line:         #352821;
  --line-2:       #44342B;

  --success:      #5CC48A;
  --success-bg:   rgba(92,196,138,.16);
  --amber:        #FFBF3F;
  --warning:      #FFBF3F;
  --amber-ink:    #FFBF3F;
  --amber-bg:     rgba(244, 201, 93,.18);
  --danger:       #F0625A;
  --danger-ink:   #F57A73;
  --danger-bg:    rgba(240,98,90,.16);
  --info:         #60A5FA;

  --shadow-sm:    0 1px 2px rgba(0,0,0,.4), 0 1px 3px rgba(0,0,0,.5);
  --shadow:       0 2px 5px rgba(0,0,0,.45), 0 12px 28px -10px rgba(0,0,0,.7);
  --shadow-lg:    0 4px 10px rgba(0,0,0,.5), 0 28px 60px -15px rgba(0,0,0,.9);
  --shadow-soft:  0 1px 3px rgba(0,0,0,.4);
  --overlay:      rgba(0,0,0,.75);

  --cta:            #FFBF3F;                 /* Amarillo dorado brillante          */
  --cta-ink:        #2C1B14;
  --cta-glow:       0 4px 20px rgba(255, 191, 63, .25);   /* resplandor suave        */
  --bar-bg:         rgba(30, 18, 12, .85);   /* cristal oscuro translúcido         */
}

/* ── TEMA 3: ORO IMPERIAL & CAVA CHAMPAGNE ────────────────────────── */
:root[data-theme="dorado"] {
  --brand:        #8C6D28;
  --brand-hover:  #A48133;
  --ink:          #71561D;
  --brand-soft:   rgba(140, 109, 40, 0.12);
  --on-brand:     #FFFFFF;
  --gold:         #E3A72F;

  --bg:           #FFFDF8;
  --surface:      #FFFFFF;
  --surface-2:    #F6EBD3;
  --cream:        #FFFDF8;
  --cream-light:  #FFFFFF;
  --cream-deep:   #EFE3C7;
  --cream-border: #E8DAC0;
  --cream-line:   #DAC8A4;
  --cream-chip:   #F6EBD3;
  --text:         #241E15;
  --muted:        #6D6252;
  --faint:        #857967;
  --line:         #E5D9C2;
  --line-2:       #D6C4A3;

  --success:      #2A7348;
  --success-bg:   #E5F3EB;
  --amber:        #B27B2B;
  --warning:      #B27B2B;
  --amber-ink:    #825516;
  --amber-bg:     rgba(178, 123, 43, 0.14);
  --danger:       #C84236;
  --danger-ink:   #A32F24;
  --danger-bg:    #FCE8E6;
  --info:         #2B6CB0;
}

/* ── TEMA 4: BISTRO BOTÁNICO & OLIVA ESMERALDA ────────────────────── */
:root[data-theme="esmeralda"] {
  --brand:        #204E38;
  --brand-hover:  #2B664A;
  --ink:          #1C4431;
  --brand-soft:   rgba(32, 78, 56, 0.12);
  --on-brand:     #F4FAF6;
  --gold:         #9BB68A;

  --bg:           #F2F6F3;
  --surface:      #FFFFFF;
  --surface-2:    #E3ECE5;
  --cream:        #F2F6F3;
  --cream-light:  #FFFFFF;
  --cream-deep:   #DCE8E0;
  --cream-border: #D1DFD6;
  --cream-line:   #BDD0C3;
  --cream-chip:   #E3ECE5;
  --text:         #13251C;
  --muted:        #50675B;
  --faint:        #6A8175;
  --line:         #D1DFD6;
  --line-2:       #BDD0C3;

  --success:      #1F7A46;
  --success-bg:   #E4F4EB;
  --amber:        #AC7928;
  --warning:      #AC7928;
  --amber-ink:    #7D5312;
  --amber-bg:     rgba(172, 121, 40, 0.14);
  --danger:       #C83C3C;
  --danger-ink:   #A52A2A;
  --danger-bg:    #FCE8E8;
  --info:         #2563EB;
}

/* ── TEMA 5: ATARDECER & BRASA VIVA (TERRACOTA) ───────────────────── */
:root[data-theme="sunset"] {
  --brand:        #872B15;
  --brand-hover:  #A4361C;
  --ink:          #742310;
  --brand-soft:   rgba(135, 43, 21, 0.12);
  --on-brand:     #FFFFFF;
  --gold:         #E08E45;

  --bg:           #FFFDF8;
  --surface:      #FFFDFB;
  --surface-2:    #F1E3C4;
  --cream:        #FFFDF8;
  --cream-light:  #FFFDFB;
  --cream-deep:   #E8D6C7;
  --cream-border: #E2CEC0;
  --cream-line:   #D4BCAC;
  --cream-chip:   #F1E3C4;
  --text:         #261611;
  --muted:        #6E5750;
  --faint:        #856C64;
  --line:         #E2CEC0;
  --line-2:       #D4BCAC;

  --success:      #2A7348;
  --success-bg:   #E5F2EA;
  --amber:        #C26122;
  --warning:      #C26122;
  --amber-ink:    #8F4010;
  --amber-bg:     rgba(194, 97, 34, 0.14);
  --danger:       #CC382B;
  --danger-ink:   #A8271C;
  --danger-bg:    #FCE7E5;
  --info:         #2B6CB0;
}

:root {
  /* ── Alias usados por app.css y las vistas (apuntan a los tokens) ──── */
  --color-brand:          var(--brand);
  --color-brand-hover:    var(--brand-hover);
  --color-bg:             var(--bg);
  --color-card:           var(--surface);
  --color-accent:         var(--gold);
  --color-text:           var(--text);
  --color-text-secondary: var(--muted);
  --color-success:        var(--success);
  --color-danger:         var(--danger);

  --color-on-brand:        var(--on-brand);
  --color-on-brand-muted:  #F6EBD3; /* Crema cálido legible sobre borgoña */
  --color-line-on-brand:   rgba(246, 235, 211, 0.14);
  --color-hover-row:       var(--surface-2);
  --color-brand-bg:        var(--brand-soft);
  --color-accent-bg:       var(--surface-2);
  --color-success-bg:      var(--success-bg);
  --color-success-bg-hover:color-mix(in srgb, var(--success) 26%, var(--surface));
  --color-danger-bg:       var(--danger-bg);
  --color-focus-ring:      color-mix(in srgb, var(--brand) 28%, transparent);
  --color-overlay:         var(--overlay);
  --color-shadow:          color-mix(in srgb, var(--text) 16%, transparent);
  --shadow-card:           var(--shadow);

  /* Alias de nombres antiguos (--c-*) y bordes */
  --border:   var(--line);
  --border-2: var(--line-2);
  --c-dark:   var(--text);
  --c-muted:  var(--muted);
  --c-cream:  var(--bg);
  --c-white:  var(--surface);
  --c-gold:   var(--gold);
  --c-red:    var(--danger);
  --c-border: var(--line);
  --c-shadow: var(--shadow);

  /* Bootstrap */
  --bs-body-bg:          var(--bg);
  --bs-body-color:       var(--text);
  --bs-secondary-color:  var(--muted);
  --bs-border-color:     var(--line);
  --bs-link-color:       var(--ink);
  --bs-link-hover-color: var(--brand-hover);
  --bs-emphasis-color:   var(--text);
  --bs-heading-color:    var(--text);
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
  line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.028em;
  line-height: 1.15;
  color: var(--text);
}

.serif {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.mono, .tabular, code {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

a {
  color: var(--ink);
  transition: color 150ms var(--ease);
}
a:hover { color: var(--brand-hover); }

::placeholder { color: var(--faint); opacity: 1; }

.btn-primary {
  color: var(--on-brand);
  background-color: var(--brand);
  border-color: var(--brand);
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
  color: var(--on-brand);
  background-color: var(--brand-hover);
  border-color: var(--brand-hover);
}

.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
  color: var(--on-brand);
  background-color: var(--brand);
}

.form-control, .form-select, .form-check-input {
  color: var(--text);
  background-color: var(--surface);
  border-color: var(--line-2);
  border-radius: var(--r-control);
}
.form-control:focus, .form-select:focus, .form-check-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 .2rem var(--color-focus-ring);
}
.form-check-input:checked {
  background-color: var(--brand);
  border-color: var(--brand);
}

/* Validación: texto de error con --danger-ink (legible) */
.text-danger, .field-validation-error, .validation-summary-errors {
  color: var(--danger-ink) !important;
  font-weight: 600;
}
.input-validation-error { border-color: var(--danger) !important; }

.border-top    { border-top:    1px solid var(--line) !important; }
.border-bottom { border-bottom: 1px solid var(--line) !important; }
.box-shadow    { box-shadow: var(--shadow-soft); }

/* Avatares (colores sueltos de la paleta) */
.avatar-1 { background: var(--avatar-1); } .avatar-2 { background: var(--avatar-2); }
.avatar-3 { background: var(--avatar-3); } .avatar-4 { background: var(--avatar-4); }
.avatar-5 { background: var(--avatar-5); } .avatar-6 { background: var(--avatar-6); }

/* ── ACCESIBILIDAD & WCAG 2.1 AA ─────────────────────────────────────────── */
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 100000;
  padding: 10px 18px;
  background: #E3A72F;
  color: #18060A !important;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 8px;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  transition: top 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.skip-link:focus, .skip-link:focus-visible {
  top: 16px;
  outline: 3px solid #FFFFFF;
  outline-offset: 2px;
}

:focus-visible {
  outline: 2px solid #E3A72F;
  outline-offset: 3px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
  outline: none;
}

/* ── PREFERS-REDUCED-MOTION ────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   REGLAS GLOBALES DE COMPONENTES PARA MODO OSCURO (DATA-THEME="DARK")
   ══════════════════════════════════════════════════════════════════════════ */
html[data-theme="dark"] body {
  background-color: var(--bg) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .main-content,
html[data-theme="dark"] .page-body {
  background-color: var(--bg);
}

html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .input-field,
html[data-theme="dark"] .ticket-input {
  background-color: var(--surface-2) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: var(--muted) !important;
  opacity: 0.75;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .checkout-card,
html[data-theme="dark"] .ticket-wrap,
html[data-theme="dark"] .auth-modal-box,
html[data-theme="dark"] .modal-box,
html[data-theme="dark"] .profile-dropdown,
html[data-theme="dark"] .kfc-hero-bar,
html[data-theme="dark"] .mod-option-btn,
html[data-theme="dark"] .drawer-content {
  background-color: var(--surface) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}

html[data-theme="dark"] .delivery-tab,
html[data-theme="dark"] .payment-box {
  background-color: var(--surface-2) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}
html[data-theme="dark"] .delivery-tab.active,
html[data-theme="dark"] .payment-box.active {
  background-color: var(--surface) !important;
  border-color: var(--gold) !important;
}

html[data-theme="dark"] .tab-title,
html[data-theme="dark"] .pay-title,
html[data-theme="dark"] .input-label,
html[data-theme="dark"] .card-head h3,
html[data-theme="dark"] .checkout-title {
  color: var(--text) !important;
}

html[data-theme="dark"] .topbar {
  background: var(--surface) !important;
  border-bottom: 1px solid var(--line) !important;
}
html[data-theme="dark"] .sb-toggle {
  background: var(--surface-2) !important;
  border-color: rgba(227, 167, 47, 0.35) !important;
  color: var(--gold, #E3A72F) !important;
}
html[data-theme="dark"] .sb-toggle:hover {
  border-color: var(--gold, #E3A72F) !important;
  background: rgba(227, 167, 47, 0.18) !important;
}
html[data-theme="dark"] .top-search input {
  background: var(--surface-2) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}

html[data-theme="dark"] table thead th {
  background-color: var(--surface-2) !important;
  color: var(--text) !important;
  border-bottom-color: var(--line) !important;
}
html[data-theme="dark"] table tbody td {
  border-bottom-color: var(--line) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .section-pad {
  background: var(--bg) !important;
}

/* ── Salvaguardas globales de contraste para Modo Oscuro en Panel Admin ── */
html[data-theme="dark"] .card-pro,
html[data-theme="dark"] .tbl-wrap,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .glass-card,
html[data-theme="dark"] .mesa-card,
html[data-theme="dark"] .prod-card,
html[data-theme="dark"] .kds-card {
  background-color: var(--surface) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}

html[data-theme="dark"] .pg-title,
html[data-theme="dark"] .sec-title,
html[data-theme="dark"] .stat-value,
html[data-theme="dark"] .form-lbl {
  color: var(--text) !important;
}

html[data-theme="dark"] .pg-sub,
html[data-theme="dark"] .stat-label,
html[data-theme="dark"] .text-muted {
  color: var(--muted) !important;
}

html[data-theme="dark"] .pg-icon {
  background: rgba(255, 213, 79, 0.14) !important;
  border-color: rgba(255, 213, 79, 0.32) !important;
  color: var(--gold) !important;
}

html[data-theme="dark"] .pg-icon svg {
  stroke: var(--gold) !important;
}

html[data-theme="dark"] .btn-ghost {
  background: var(--surface-2) !important;
  color: var(--text) !important;
  border-color: var(--line-2) !important;
}
html[data-theme="dark"] .btn-ghost:hover {
  border-color: var(--gold) !important;
  color: var(--gold) !important;
}

html[data-theme="dark"] .bp-gold {
  background: rgba(255, 213, 79, 0.16) !important;
  color: var(--gold) !important;
  border: 1px solid rgba(255, 213, 79, 0.32);
}

html[data-theme="dark"] .bp-warn {
  background: rgba(245, 158, 11, 0.16) !important;
  color: #FCD34D !important;
}

html[data-theme="dark"] .bp-ok {
  background: rgba(16, 185, 129, 0.16) !important;
  color: #6EE7B7 !important;
}

html[data-theme="dark"] .bp-danger {
  background: rgba(239, 68, 68, 0.18) !important;
  color: #FCA5A5 !important;
}

html[data-theme="dark"] .bp-muted {
  background: var(--surface-2) !important;
  color: var(--muted) !important;
}

/* ── BOTÓN TOGGLE DE MODO OSCURO (LUXURY EMIL KOWALSKI STYLE) ───────────── */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--surface-2, rgba(255, 255, 255, 0.12));
  color: var(--gold, #E3A72F);
  border: 1px solid var(--line, rgba(227, 167, 47, 0.3));
  cursor: pointer;
  padding: 0;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
  position: relative;
  flex-shrink: 0;
}
.theme-toggle-btn:hover {
  transform: translateY(-1px);
  border-color: var(--gold, #E3A72F);
  background: var(--surface, rgba(255, 255, 255, 0.2));
}
.theme-toggle-btn:active {
  transform: scale(0.94);
}
.theme-toggle-btn svg {
  width: 18px;
  height: 18px;
  transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1), opacity 200ms ease;
}

/* Iconos de Sol / Luna */
.theme-icon-sun { display: none; }
.theme-icon-moon { display: block; }

html[data-theme="dark"] .theme-icon-sun { display: block; }
html[data-theme="dark"] .theme-icon-moon { display: none; }

/* ══════════════════════════════════════════════════════════════════════════
   PLANTILLA BORGOÑA Y CREMA (SABORATOR ALTA COCINA)
   Diseño de Gala Gastronómica · Emil Kowalski Engineering Polish
   ══════════════════════════════════════════════════════════════════════════ */

/* ── NAVBAR GOURMET BORGOÑA & CREMA ─────────────────────────────────────── */
.gourmet-navbar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--brand, #6B4226);
  color: var(--on-brand, #FFFFFF);
  border-bottom: 1.5px solid rgba(227, 167, 47, 0.35);
  box-shadow: 0 4px 24px rgba(38, 24, 18, 0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background-color 200ms var(--ease), border-color 200ms var(--ease);
}

:root[data-theme="dark"] .gourmet-navbar {
  background: #1A090E;
  border-bottom-color: rgba(227, 167, 47, 0.25);
  box-shadow: 0 4px 28px rgba(0, 0, 0, 0.6);
}

.gourmet-nav-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.gourmet-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--on-brand, #FFFFFF);
  flex-shrink: 0;
  transition: transform 160ms var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .gourmet-brand:hover { transform: translateY(-1px); }
}
.gourmet-brand:active { transform: scale(0.97); }

.gourmet-brand-icon {
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(227, 167, 47, 0.45);
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold, #E3A72F);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.gourmet-brand-icon svg { width: 24px; height: 22px; fill: currentColor; }

.gourmet-brand-text { display: flex; flex-direction: column; }
.gourmet-brand-title {
  font-family: var(--font-serif, 'Bebas Neue', 'Inter', sans-serif);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--on-brand, #FFFFFF);
  line-height: 1.05;
}
.gourmet-brand-sub {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold, #E3A72F);
  font-weight: 700;
  line-height: 1;
  margin-top: 2px;
}

.gourmet-links {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: nowrap;
  white-space: nowrap;
  min-width: 0;
  /* Si los enlaces no caben se desplazan; la barra solo aparece al pasar el cursor */
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 7px;
  margin-bottom: -7px;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
.gourmet-links:hover {
  scrollbar-color: rgba(255, 255, 255, 0.55) transparent;
}
.gourmet-links::-webkit-scrollbar { height: 6px; }
.gourmet-links::-webkit-scrollbar-track { background: transparent; }
.gourmet-links::-webkit-scrollbar-thumb { background: transparent; border-radius: 99px; }
.gourmet-links:hover::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.55); }
.gourmet-links:hover::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.8); }

@media (max-width: 1200px) {
  .gourmet-link {
    font-size: 0.8rem;
    padding: 0.4rem 0.65rem;
  }
}

.gourmet-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.48rem 0.85rem;
  border-radius: 9px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  transition: color 150ms var(--ease), background-color 150ms var(--ease), transform 120ms var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .gourmet-link:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
  }
}
.gourmet-link:active { transform: scale(0.97); }
.gourmet-link.active {
  color: #FFFFFF;
  background: rgba(227, 167, 47, 0.22);
  border: 1px solid rgba(227, 167, 47, 0.4);
}
.gourmet-link.staff-link {
  background: rgba(227, 167, 47, 0.18);
  border: 1px dashed rgba(227, 167, 47, 0.5);
  color: var(--gold, #E3A72F);
}

.gourmet-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.gourmet-btn-login {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1rem;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #FFFFFF;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), transform 120ms var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .gourmet-btn-login:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: #FFFFFF;
    color: #FFFFFF;
    transform: translateY(-1px);
  }
}
.gourmet-btn-login:active { transform: scale(0.97); }

.gourmet-btn-register {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1.15rem;
  border-radius: 9px;
  background: var(--gold, #E3A72F);
  border: 1px solid var(--gold, #E3A72F);
  color: #18060A;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(227, 167, 47, 0.35);
  transition: background-color 150ms var(--ease), transform 140ms var(--ease), box-shadow 160ms var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .gourmet-btn-register:hover {
    background: #DFC188;
    color: #18060A;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(227, 167, 47, 0.45);
  }
}
.gourmet-btn-register:active { transform: scale(0.97); }

.gourmet-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.28rem 0.75rem 0.28rem 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #FFFFFF;
}
.gourmet-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gold, #E3A72F);
  color: #18060A;
  font-weight: 800;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gourmet-user-name {
  font-size: 0.82rem;
  font-weight: 600;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gourmet-btn-logout {
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  transition: color 140ms var(--ease), transform 120ms var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .gourmet-btn-logout:hover { color: #F87171; transform: scale(1.1); }
}

.gourmet-mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  width: 34px;
  height: 34px;
  padding: 7px 6px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.gourmet-mobile-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: #FFFFFF;
  border-radius: 2px;
}

.gourmet-mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--brand, #6B4226);
  border-top: 1px solid rgba(227, 167, 47, 0.3);
  padding: 1rem 1.5rem;
  gap: 0.65rem;
}
.gourmet-mobile-menu.open { display: flex; }
.gourmet-mobile-item {
  color: #FFFFFF;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.gourmet-mobile-item:last-child { border-bottom: none; }

@media (max-width: 1024px) {
  .gourmet-nav-container {
    height: auto !important;
    min-height: 60px;
    padding: 0.55rem 0.9rem !important;
    flex-wrap: wrap;
    gap: 0.45rem;
  }
  /* La marca ocupa el espacio sobrante (basis 0) para que logo, nombre y
     acciones queden siempre en la misma fila, centrados verticalmente. */
  .gourmet-brand {
    flex: 1 1 0;
    min-width: 0;
    gap: 0.5rem;
  }
  .gourmet-brand-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }
  .gourmet-brand-text {
    min-width: 0;
  }
  .gourmet-brand-title {
    font-size: 1.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .gourmet-actions {
    gap: 0.4rem;
  }
  .gourmet-user-name {
    max-width: 72px;
  }
  .gourmet-links {
    display: flex !important;
    order: 3;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-top: 0.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    gap: 0.35rem;
  }
  .gourmet-links::-webkit-scrollbar {
    display: none;
  }
  .gourmet-link {
    font-size: 0.76rem;
    padding: 0.32rem 0.65rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    flex-shrink: 0;
  }
  .gourmet-btn-register {
    display: none;
  }
  .gourmet-btn-login {
    padding: 0.35rem 0.65rem;
    font-size: 0.76rem;
  }
  .gourmet-mobile-toggle { display: flex; }
}

/* ── CONTENEDOR CLIENTE & WRAPPER CREMA ─────────────────────────────────── */
.gourmet-client-main {
  min-height: calc(100vh - 180px);
  background: var(--bg, #F6EBD3);
  background-image: radial-gradient(circle at 1px 1px, rgba(107, 66, 38, 0.045) 1px, transparent 0);
  background-size: 24px 24px;
  color: var(--text, #3E2615);
  padding: 1.75rem clamp(1rem, 2.5vw, 2.5rem) 4rem;
  max-width: 1360px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

:root[data-theme="dark"] .gourmet-client-main {
  background: var(--bg, #17110E);
  background-image: radial-gradient(circle at 1px 1px, rgba(246, 235, 211, 0.035) 1px, transparent 0);
  color: var(--text, #F6EBD3);
}

/* ── FOOTER GOURMET BORGOÑA & CREMA ─────────────────────────────────────── */
.gourmet-footer {
  background: var(--marron-oscuro, #3E2615);
  color: var(--on-brand, #FFFFFF);
  border-top: 2px solid var(--gold, #E3A72F);
  padding-top: 3.5rem;
}

:root[data-theme="dark"] .gourmet-footer {
  background: #14070A;
  border-top-color: rgba(227, 167, 47, 0.35);
}

.gourmet-footer-top {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

.gourmet-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.1fr 1.1fr;
  gap: 2.5rem;
}
@media (max-width: 960px) {
  .gourmet-footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
@media (max-width: 580px) {
  .gourmet-footer-grid { grid-template-columns: 1fr; gap: 2rem; }
}

.gourmet-footer-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-serif, 'Bebas Neue', 'Inter', sans-serif);
  font-size: 1.85rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 0.85rem;
}
.gourmet-footer-logo svg { width: 32px; height: 30px; fill: var(--gold, #E3A72F); }

.gourmet-footer-tagline {
  font-size: 0.88rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 1.25rem;
  max-width: 360px;
}

.gourmet-footer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.gourmet-chip {
  font-size: 0.74rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(227, 167, 47, 0.35);
  color: var(--gold, #E3A72F);
  font-weight: 600;
}

.gourmet-footer-title {
  font-family: var(--font-serif, 'Bebas Neue', 'Inter', sans-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gold, #E3A72F);
  margin: 0 0 1rem;
  letter-spacing: 0.02em;
}

.gourmet-link-list,
.gourmet-hours-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.87rem;
}

.gourmet-link-list a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: color 140ms var(--ease), transform 120ms var(--ease);
  display: inline-block;
}
@media (hover: hover) and (pointer: fine) {
  .gourmet-link-list a:hover {
    color: var(--gold, #E3A72F);
    transform: translateX(3px);
  }
}

.gourmet-hours-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.4rem;
}
.gourmet-hours-list li:last-child { border-bottom: none; }
.gourmet-hours-list strong { color: #FFFFFF; font-size: 0.84rem; }

.gourmet-btn-wa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #25D366;
  color: #072E14;
  font-weight: 700;
  font-size: 0.84rem;
  padding: 0.5rem 1rem;
  border-radius: 9px;
  text-decoration: none;
  box-shadow: 0 3px 12px rgba(37, 211, 102, 0.25);
  transition: transform 140ms var(--ease), box-shadow 160ms var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .gourmet-btn-wa:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.35);
    color: #072E14;
  }
}
.gourmet-btn-wa:active { transform: scale(0.97); }

.gourmet-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.15);
  padding: 1.25rem 1.5rem;
}
.gourmet-footer-bottom-inner {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.7);
}
.gourmet-legal-links {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.gourmet-legal-links a,
.gourmet-cookie-link {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  font-size: 0.82rem;
  cursor: pointer;
  transition: color 140ms var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .gourmet-legal-links a:hover,
  .gourmet-cookie-link:hover { color: var(--gold, #E3A72F); }
}

/* ══════════════════════════════════════════════════════════════════════════
   ESTILOS DE AVATARES DE USUARIO & SELECTOR DE TEMAS (EMIL KOWALSKI POLISH)
   ══════════════════════════════════════════════════════════════════════════ */
.top-avatar {
  overflow: hidden !important;
  position: relative;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
}
.top-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.gourmet-user-avatar {
  overflow: hidden !important;
  position: relative;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
}
.gourmet-user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

/* Transición suave global de color al cambiar temas */
body, .main-content, .sb, .topbar, .gourmet-navbar, .gourmet-footer,
.modal-overlay, .dropdown-menu, .card, .table {
  transition: background-color 220ms var(--ease),
              color 220ms var(--ease),
              border-color 220ms var(--ease);
}

/* Cuadrícula de Avatares Prediseñados */
.avatar-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 0.75rem;
  margin-top: 0.85rem;
}
.avatar-preset-btn {
  background: var(--surface, #FFFFFF);
  border: 2px solid var(--line, #E8D5B0);
  border-radius: 16px;
  padding: 6px;
  cursor: pointer;
  transition: transform 160ms var(--ease), border-color 160ms var(--ease), box-shadow 160ms var(--ease);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.avatar-preset-btn:hover {
  transform: translateY(-2px);
  border-color: var(--brand, #6B4226);
  box-shadow: 0 4px 12px var(--color-shadow, rgba(0,0,0,0.08));
}
.avatar-preset-btn.active {
  border-color: var(--brand, #6B4226);
  background: var(--brand-soft, rgba(107, 66, 38,0.08));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent);
}
.avatar-preset-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.avatar-preset-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text, #3E2615);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60px;
}

/* Tarjetas de Selección de Tema */
.theme-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}
.theme-card {
  background: var(--surface, #FFFFFF);
  border: 2px solid var(--line, #E8D5B0);
  border-radius: 16px;
  padding: 1.15rem;
  cursor: pointer;
  position: relative;
  transition: all 180ms var(--ease);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
}
.theme-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand, #6B4226);
  box-shadow: 0 8px 20px -4px var(--color-shadow, rgba(0,0,0,0.1));
}
.theme-card.active {
  border-color: var(--brand, #6B4226);
  background: var(--brand-soft, rgba(107, 66, 38,0.06));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 28%, transparent);
}
.theme-card-swatches {
  display: flex;
  gap: 6px;
  margin-bottom: 0.75rem;
}
.theme-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.12);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}
.theme-card-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text, #3E2615);
  margin: 0 0 4px 0;
}
.theme-card-desc {
  font-size: 0.74rem;
  color: var(--muted, #6B7280);
  line-height: 1.4;
  margin: 0;
}
.theme-active-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 0.75rem;
  font-size: 0.70rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand, #6B4226);
  color: var(--on-brand, #FFFFFF);
}

/* Área de Drop / Subida de Foto */
.avatar-dropzone {
  border: 2px dashed var(--line, #E8D5B0);
  border-radius: 14px;
  padding: 1.25rem 1rem;
  text-align: center;
  background: var(--surface-2, #FFFDF8);
  cursor: pointer;
  transition: all 160ms var(--ease);
}
.avatar-dropzone:hover,
.avatar-dropzone.dragover {
  border-color: var(--brand, #6B4226);
  background: var(--brand-soft, rgba(107, 66, 38,0.06));
}



