/* =====================================================================
   MenuRest — Design System (2026)
   Solo capa visual: complementa y moderniza Materialize. No cambia ninguna
   funcionalidad, id, nombre de campo ni comportamiento. Mobile-first.
   ===================================================================== */

:root {
    /* Marca (teal premium) */
    --brand-050: #f0fdfa;
    --brand-100: #ccfbf1;
    --brand-400: #2dd4bf;
    --brand-500: #14b8a6;
    --brand-600: #0d9488;
    --brand-700: #0f766e;
    --brand-800: #115e59;
    --brand: var(--brand-600);

    /* Neutros / superficie / texto */
    --bg:        #f6f7f9;
    --surface:   #ffffff;
    --surface-2: #f9fafb;
    --border:    #e7e9ee;
    --border-2:  #eef0f4;
    --text:      #1c2330;
    --text-soft: #5b6577;
    --text-mute: #8a93a3;

    /* Semánticos */
    --ok:   #16a34a;
    --warn: #d97706;
    --err:  #dc2626;
    --info: #2563eb;

    /* Radios, sombras, transición */
    --r-sm: 8px;
    --r:    12px;
    --r-lg: 16px;
    --r-pill: 999px;
    --shadow-sm: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
    --shadow-md: 0 6px 16px rgba(16,24,40,.08);
    --shadow-lg: 0 16px 40px rgba(16,24,40,.14);
    --ring: 0 0 0 3px rgba(13,148,136,.22);
    --t: 180ms cubic-bezier(.4, 0, .2, 1);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ----------------------------------------------------------- Base */
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -.015em;
    color: var(--text);
    line-height: 1.25;
}
h4 { font-size: 1.7rem; }
h5 { font-size: 1.3rem; font-weight: 650; }
a { color: var(--brand-700); transition: color var(--t); }
a:hover { color: var(--brand-800); }
.grey-text { color: var(--text-mute) !important; }
.grey-text.text-darken-1 { color: var(--text-soft) !important; }
strong { font-weight: 650; }

code {
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: .12rem .4rem;
    border-radius: 6px;
    font-family: 'JetBrains Mono', 'Consolas', 'Courier New', monospace;
    font-size: .9em;
}
::selection { background: var(--brand-100); }

/* ------------------------------------------- Overrides de marca (teal) */
.teal { background-color: var(--brand-600) !important; }
.teal.lighten-1 { background-color: var(--brand-500) !important; }
.teal.lighten-4 { background-color: var(--brand-100) !important; }
.teal.lighten-5 { background-color: var(--brand-050) !important; }
.teal-text { color: var(--brand-700) !important; }
.teal-text.text-darken-2 { color: var(--brand-800) !important; }

/* ----------------------------------------------------------- Layout */
main { min-height: calc(100vh - 64px - 80px); padding-bottom: 2rem; }
.container { width: 92%; max-width: 1180px; }

@media only screen and (min-width: 993px) {
    body.admin-layout main { padding-left: 280px; }
}
.admin-content { padding: 1.5rem 1.75rem 3.5rem; max-width: 1240px; }
.admin-content > h4:first-child,
.admin-content > h5:first-child { margin-top: .25rem; }

/* ----------------------------------------------------------- Navbar */
nav {
    background: var(--brand-600);
    box-shadow: var(--shadow-sm);
    height: 64px; line-height: 64px;
}
nav .brand-logo { font-weight: 700; letter-spacing: -.02em; font-size: 1.5rem; }
.brand-logo i.material-icons { vertical-align: middle; margin-right: .35rem; }
.admin-topnav { height: 60px; line-height: 60px; }

/* --------------------------------------------------------- Sidenav */
.sidenav {
    width: 280px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
    border-right: 1px solid var(--border);
    padding-top: .25rem;
}
.sidenav .user-view {
    background: linear-gradient(135deg, var(--brand-600), var(--brand-800));
    margin-bottom: .5rem;
    padding: 22px 18px !important;
}
.sidenav .user-view a { font-weight: 700; letter-spacing: -.01em; }
.sidenav li { margin: 2px 10px; }
.sidenav li > a {
    border-radius: var(--r-sm);
    color: var(--text-soft);
    font-weight: 550;
    height: 46px; line-height: 46px;
    display: flex; align-items: center;
    transition: background var(--t), color var(--t);
}
.sidenav li > a > i.material-icons {
    color: var(--text-mute);
    margin-right: 14px; line-height: 46px;
    transition: color var(--t);
}
.sidenav li > a:hover { background: var(--surface-2); color: var(--text); }
.sidenav li.active { background: transparent; }
.sidenav li.active > a {
    background: var(--brand-050);
    color: var(--brand-700);
    font-weight: 650;
}
.sidenav li.active > a > i.material-icons { color: var(--brand-600); }
.sidenav .divider { margin: .5rem 16px; background: var(--border); }
.sidenav li > a.btn-flat { text-transform: none; font-weight: 550; }

/* ----------------------------------------------- Cards & paneles */
.card, .card-panel {
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: box-shadow var(--t), transform var(--t);
}
.card { background: var(--surface); }
.card .card-content { padding: 1.4rem 1.5rem; }
.card .card-content .card-title { font-weight: 700; letter-spacing: -.01em; font-size: 1.2rem; }
.card .card-action { border-top: 1px solid var(--border-2); padding: 1rem 1.5rem; }
.card-panel { padding: 1.25rem 1.4rem; }
.hoverable:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
a.card.hoverable:hover { transform: translateY(-3px); }

/* Accesos rápidos del dashboard (card-panel center con icono grande) */
.card-panel.center-align .material-icons.large { font-size: 2.6rem; }
.card-panel.center-align h3,
.card-panel.center-align h5 { font-weight: 750; letter-spacing: -.02em; }

/* ----------------------------------------------------------- Alertas */
.card-panel.red.lighten-4,
.card-panel.green.lighten-4,
.card-panel.amber.lighten-4,
.card-panel.orange.lighten-4,
.card-panel.blue.lighten-4 {
    border: 1px solid var(--border);
    border-left-width: 4px;
    border-radius: var(--r);
    box-shadow: var(--shadow-sm);
    display: flex; align-items: flex-start; gap: .25rem; flex-wrap: wrap;
}
.card-panel.red.lighten-4   { border-left-color: var(--err); }
.card-panel.green.lighten-4 { border-left-color: var(--ok); }
.card-panel.amber.lighten-4,
.card-panel.orange.lighten-4 { border-left-color: var(--warn); }
.card-panel.blue.lighten-4  { border-left-color: var(--info); }
.card-panel .material-icons.left { margin-right: .5rem; }

/* ----------------------------------------------------------- Botones */
.btn, .btn-large, .btn-small, .btn-flat {
    border-radius: var(--r-sm);
    text-transform: none;
    font-weight: 600;
    letter-spacing: 0;
    box-shadow: none;
    transition: transform var(--t), box-shadow var(--t), background var(--t), color var(--t);
}
.btn, .btn-large, .btn-small {
    background-color: var(--brand-600);
    box-shadow: var(--shadow-sm);
}
.btn:hover, .btn-large:hover, .btn-small:hover {
    background-color: var(--brand-700);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.btn:focus, .btn-large:focus, .btn-small:focus { background-color: var(--brand-700); }
.btn-flat { color: var(--text-soft); }
.btn-flat:hover { background: var(--surface-2); color: var(--text); }
.btn-large { border-radius: var(--r); height: 50px; line-height: 50px; }
.btn:disabled, .btn-large:disabled, .btn-small:disabled { box-shadow: none; }

/* Floating action buttons */
.btn-floating { box-shadow: var(--shadow-md); transition: transform var(--t), box-shadow var(--t); }
.btn-floating:hover { transform: translateY(-2px) scale(1.03); box-shadow: var(--shadow-lg); }

/* Chips de filtro clicables */
.chip { border-radius: var(--r-pill); font-weight: 550; }
a.chip { cursor: pointer; transition: background var(--t), color var(--t), box-shadow var(--t); }
a.chip:hover { box-shadow: var(--shadow-sm); }

/* ----------------------------------------------------------- Formularios */
.input-field > label { color: var(--text-mute); }
.input-field > input[type=text],
.input-field > input[type=email],
.input-field > input[type=password],
.input-field > input[type=tel],
.input-field > input[type=number],
.input-field > input[type=search],
.input-field > input[type=date],
.input-field > textarea.materialize-textarea {
    border-bottom: 1px solid var(--border);
    transition: border-color var(--t), box-shadow var(--t);
}
.input-field input:focus:not([type=checkbox]),
.input-field textarea.materialize-textarea:focus {
    border-bottom: 2px solid var(--brand-600) !important;
    box-shadow: 0 1px 0 0 var(--brand-600) !important;
}
.input-field input:focus + label,
.input-field textarea:focus + label { color: var(--brand-700) !important; }
.input-field .prefix.active { color: var(--brand-600); }
input[type=color] { border: 1px solid var(--border); border-radius: var(--r-sm); height: 42px; cursor: pointer; }
select.browser-default {
    border: 1px solid var(--border); border-radius: var(--r-sm);
    padding: .55rem .7rem; background: var(--surface); color: var(--text);
}
.file-field .btn { border-radius: var(--r-sm) 0 0 var(--r-sm); }

/* ----------------------------------------------------------- Tablas */
table { border-collapse: separate; border-spacing: 0; }
table thead th {
    font-size: .76rem; text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-mute); font-weight: 650;
    border-bottom: 1px solid var(--border);
    padding: .85rem .9rem;
}
table td { padding: .85rem .9rem; border-radius: 0; }
table.striped > tbody > tr:nth-child(odd) { background: transparent; }
table.highlight > tbody > tr, table.striped > tbody > tr { transition: background var(--t); }
table.striped > tbody > tr:hover, table.highlight > tbody > tr:hover { background: var(--surface-2); }
table > tbody > tr { border-bottom: 1px solid var(--border-2); }
table td .material-icons.tiny { vertical-align: middle; margin-right: .35rem; color: var(--brand-700); }

/* ----------------------------------------------------------- Badges */
.badge, .new.badge {
    border-radius: var(--r-pill);
    font-weight: 600; font-size: .72rem;
    padding: 0 .6rem; height: 22px; line-height: 22px;
}
.new.badge { color: #fff; }

/* --------------------------------------------------------- Colapsable */
.collapsible {
    border: 1px solid var(--border); border-radius: var(--r);
    box-shadow: var(--shadow-sm); overflow: hidden;
}
.collapsible-header {
    background: var(--surface); font-weight: 550; border-bottom: 1px solid var(--border-2);
    transition: background var(--t);
}
.collapsible-header:hover { background: var(--surface-2); }
.collapsible-header i { color: var(--brand-600); }

/* ------------------------------------------------------------ Progreso */
.progress { background-color: var(--brand-100); border-radius: var(--r-pill); height: 8px; overflow: hidden; }
.progress .determinate { background-color: var(--brand-600); }

/* ----------------------------------------------------------- Modales */
.modal {
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}
.modal .modal-content { padding: 1.6rem 1.75rem; }
.modal .modal-content h5 { margin-top: 0; }
.modal .modal-footer {
    border-top: 1px solid var(--border-2);
    padding: 0 1.25rem; height: 60px;
    background: var(--surface-2);
    border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.modal-overlay { background: rgba(16,24,40,.55); }

/* Toasts */
.toast { border-radius: var(--r); box-shadow: var(--shadow-lg); font-weight: 550; }

/* ----------------------------------------------------------- Footer */
.page-footer { padding-top: 1.5rem; border-top: 1px solid var(--border); }

/* =====================================================================
   Helpers del panel
   ===================================================================== */
.thumb { width: 56px; height: 56px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--border); }
.thumb-placeholder {
    width: 56px; height: 56px; display: flex; align-items: center; justify-content: center;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--text-mute);
}
.status-disponible { color: var(--ok); }
.status-agotado    { color: var(--warn); }
.status-oculto     { color: var(--text-mute); }
.btn-move { padding: 0 .5rem; height: 28px; line-height: 28px; border-radius: var(--r-sm); }

/* Contenedor de mapa (Leaflet) */
.loc-map { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }

/* =====================================================================
   Menú público (respeta var(--brand) por restaurante)
   ===================================================================== */
.menu-body { background: var(--bg); }

.menu-header {
    position: relative;
    background: var(--brand, #0d9488); /* fallback sólido si no hay color-mix */
    background: linear-gradient(135deg, var(--brand, #0d9488), color-mix(in srgb, var(--brand, #0d9488) 78%, #000));
    background-size: cover; background-position: center;
    color: #fff; padding: 2.25rem 0 2.5rem; text-align: center;
}
.menu-header-inner { padding: 0 1rem; position: relative; z-index: 1; }
.menu-header h4 { color: #fff; letter-spacing: -.02em; }
.menu-logo {
    width: 92px; height: 92px; border-radius: 50%; object-fit: cover;
    border: 3px solid rgba(255,255,255,.9); background: #fff; box-shadow: var(--shadow-md);
}
.menu-logo-fallback { display: inline-flex; align-items: center; justify-content: center; color: var(--brand, #0d9488); }
.menu-logo-fallback i { font-size: 46px; line-height: 92px; }

.menu-section {
    margin: 1.9rem 0 .85rem; padding-left: .7rem;
    border-left: 4px solid var(--brand, #0d9488);
    font-weight: 700; letter-spacing: -.01em;
}

.menu-card { border-radius: var(--r-lg); border: 1px solid var(--border); box-shadow: var(--shadow-sm); transition: box-shadow var(--t), transform var(--t); }
.menu-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.menu-card.agotado { opacity: .6; }
.menu-card-row { display: flex; gap: .85rem; padding: .85rem; }
.menu-thumb { width: 88px; height: 88px; border-radius: var(--r); object-fit: cover; flex: 0 0 auto; }
.menu-card-body { flex: 1 1 auto; min-width: 0; }
.menu-desc {
    margin: .25rem 0 .55rem; font-size: .85rem; color: var(--text-soft);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.menu-card-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.menu-card-foot .price { font-weight: 700; color: var(--text); }
.menu-card-foot .btn-small { border-radius: var(--r-pill); }

/* Carrito flotante */
.cart-fab { position: fixed; right: 18px; bottom: 18px; z-index: 1000; }
.cart-badge {
    position: absolute; top: -6px; right: -6px;
    background: var(--err); color: #fff; border-radius: 50%;
    min-width: 22px; height: 22px; line-height: 22px; font-size: .72rem; font-weight: 700; text-align: center;
    box-shadow: var(--shadow-sm);
}
.cart-fab-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 999;
    color: #fff; text-align: center; padding: 1rem; font-weight: 650;
    display: none; cursor: pointer; box-shadow: 0 -4px 16px rgba(16,24,40,.12);
}
@media (min-width: 601px) { .cart-fab-bar { display: none !important; } }

.pm-image { width: 100%; max-height: 190px; object-fit: cover; border-radius: var(--r); margin-bottom: .6rem; }
.cart-line { padding: .7rem 0; border-bottom: 1px solid var(--border-2); }
.qty-row { margin-top: .4rem; }
.qty-row a {
    display: inline-block; width: 32px; height: 32px; line-height: 30px;
    text-align: center; border: 1px solid var(--border); border-radius: 50%; color: var(--text);
    transition: background var(--t), border-color var(--t);
}
.qty-row a:hover { background: var(--surface-2); border-color: var(--brand-400); }
.qty-row span { display: inline-block; min-width: 36px; text-align: center; font-weight: 600; }

/* =====================================================================
   Animaciones (suaves; respetan prefers-reduced-motion)
   ===================================================================== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.admin-content > .card,
.admin-content > .row,
.menu-card { animation: fadeUp .32s var(--t) both; }

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
