/* ============================================================
   +menu — Menú Digital QR
   Estilos compartidos: vista cliente (teléfono) + panel de control
   ============================================================ */
:root {
    --brand: #B33A3A;
    --brand-dark: #922f2f;
    --bg: #F9F7F3;
    --surface: #ffffff;
    --surface2: #F5F0E8;
    --border: #E0D8CC;
    --text: #2C2C2C;
    --text-muted: #7A6A50;
    --danger: #c0392b;
    --success: #27ae60;
    --blue: #2980b9;
    --font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

/* ============ UTILIDADES ============ */
.form-control {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 2px solid var(--border);
    background: #fff;
    font-size: 0.95rem;
    color: var(--text);
    outline: none;
    font-family: var(--font);
    transition: border-color 0.2s;
}
.form-control:focus { border-color: var(--brand); }

label { font-weight: 600; font-size: 0.85rem; display: block; margin-bottom: 6px; }
.form-group { margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    border-radius: 10px;
    padding: 11px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.15s;
    background: #eee;
    color: var(--text);
}
.btn:hover { filter: brightness(0.96); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-outline { background: #fff; border: 1.5px solid var(--border); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; border-radius: 8px; }
.btn-wa { background: #25d366; color: #fff; text-decoration: none; }

.link-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface2);
}

/* Pulso sutil estilo botón WhatsApp de la landing (solo botones de acción) */
.pulse-cta { position: relative; isolation: isolate; overflow: visible; }
.client-body .pulse-cta, .delivery-body .pulse-cta {
    background: var(--brand-dark);
    color: #fff;
    border-color: var(--brand-dark);
}
.pulse-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--brand-dark);
    opacity: 0;
    animation: waPulse 3s ease-in-out infinite;
    z-index: -1;
    pointer-events: none;
}
@keyframes waPulse {
    0% { transform: scale(1); opacity: 0; }
    30% { opacity: 0.3; }
    100% { transform: scale(1.12); opacity: 0; }
}

.switch { transform: scale(1.3); margin-right: 8px; cursor: pointer; }
.switch-label { display: flex; align-items: center; font-weight: 600; font-size: 0.9rem; cursor: pointer; color: var(--text); }

.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
}
.badge-red { background: #fdecea; color: var(--danger); }
.badge-orange { background: #fef3e2; color: #b26a00; }
.badge-blue { background: #e8f1fa; color: var(--blue); }
.badge-green { background: #e8f7ef; color: #1e7e4f; }
.badge-gray { background: #ececec; color: #666; }
.badge-purple { background: #f1e8fa; color: #7d3c98; }
.badge-warn { background: #fff4e0; color: #b26a00; }
.badge-info { background: #e8f1fa; color: var(--blue); }
.badge-success { background: #e8f7ef; color: #1e7e4f; }

.dashed { border: 0; border-top: 1px dashed #ccc; margin: 15px 0; }
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    background: var(--surface2);
    border-radius: 12px;
}

/* ============ TOAST ============ */
.toast-area { position: fixed; top: 12px; right: 12px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 99999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    font-size: 0.9rem;
    max-width: 90vw;
}

/* ============ MODAL (panel) ============ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal {
    background: #fff;
    border-radius: 14px;
    max-width: 560px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 20px 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-title { font-size: 1.15rem; font-weight: 700; color: var(--text); }
.modal-close { background: transparent; border: none; font-size: 1.4rem; cursor: pointer; color: #666; }

/* ============ PANEL: NAV ============ */
nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 10px 20px;
}
.nav-left { display: flex; align-items: center; gap: 10px; }
.nav-logo-img { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; }
.nav-logo-text { font-weight: 700; font-size: 1rem; }
.nav-logo-text span { font-size: 0.72rem; color: var(--text-muted); font-weight: 500; display: block; }
.nav-right { display: flex; align-items: center; gap: 8px; }
.nav-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.nav-tab {
    border: none;
    background: transparent;
    padding: 8px 12px;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
}
.nav-tab:hover { background: var(--surface2); }
.nav-tab.active { background: var(--brand); color: #fff; }
.nav-tab-logout { color: var(--danger); }

.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
}
.hamburger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: 0.2s; }
.mobile-drawer {
    position: fixed;
    top: 58px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: none;
    flex-direction: column;
    padding: 8px 16px;
    z-index: 999;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}
.mobile-drawer.open { display: flex; }
.mobile-drawer .nav-tab { text-align: left; padding: 12px; border-bottom: 1px solid #f3efe8; }

/* ============ PANEL: PAGE / LOGIN ============ */
.page { max-width: 1280px; margin: 0 auto; padding: 20px; }
.login-container { max-width: 400px; margin: 60px auto; }
.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.06);
    text-align: center;
    border: 1px solid var(--border);
}
.login-logo { width: 72px; height: 72px; border-radius: 18px; object-fit: cover; margin-bottom: 14px; }
.login-card h1 { font-size: 1.3rem; margin: 0 0 18px; }
.login-card .form-group { text-align: left; }
.login-hint { margin-top: 16px; font-size: 0.75rem; color: var(--text-muted); background: var(--surface2); padding: 10px; border-radius: 8px; }

.view-title { font-size: 1.35rem; margin: 0; }
.view-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }

/* ============ PANEL: STATS ============ */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
}
.stat-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-value { font-size: 1.5rem; font-weight: 800; }
.stat-value.brand { color: var(--brand); }
.stat-value.danger { color: var(--danger); }

.dashboard-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
}
.card h3 { margin: 0 0 14px; font-size: 1rem; }

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 160px;
    padding-top: 10px;
}
.chart-bar {
    flex: 1;
    background: linear-gradient(180deg, var(--brand), var(--brand-dark));
    border-radius: 6px 6px 0 0;
    min-height: 4px;
    transition: height 0.3s;
}

.top-products { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.top-product-card {
    background: var(--surface2);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
}
.top-medal { font-size: 1.6rem; }
.top-name { font-weight: 700; font-size: 0.85rem; margin: 6px 0 2px; line-height: 1.3; }
.top-qty { font-size: 0.75rem; color: var(--text-muted); }
.top-rev { font-weight: 800; color: var(--brand); font-size: 0.9rem; }

/* ============ PANEL: TABLES ============ */
html, body { overflow-x: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); padding: 10px 12px; border-bottom: 1px solid var(--border); }
.table td { padding: 10px 12px; border-bottom: 1px solid #f0ece4; }
.table tr:hover td { background: #faf8f3; }
.table-full { min-width: 640px; }

/* Evita que las tablas/tarjetas se salgan de la pantalla en grid */
.view, .admin-content, .card, .page { min-width: 0; }

/* ============ SUPERADMIN: CLIENTES (tarjetas en móvil) ============ */
.clientes-cards { display: none; }
.cliente-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 14px 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.cliente-card-top { display: flex; align-items: center; gap: 11px; }
.cliente-card-logo {
    width: 46px; height: 46px; border-radius: 12px; object-fit: contain; flex-shrink: 0;
    background: var(--surface2); padding: 4px;
}
.cliente-card-avatar {
    width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    font-size: 1.35rem;
}
.cliente-card-id { flex: 1; min-width: 0; }
.cliente-card-name { font-weight: 800; font-size: 1rem; line-height: 1.25; }
.cliente-card-sub { font-size: 0.74rem; color: var(--text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cliente-card-status { flex-shrink: 0; }
.cliente-card-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.cliente-card-chip {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: 999px; padding: 4px 10px;
    font-size: 0.75rem; font-weight: 600; color: var(--text);
}
.cliente-card-chip .chip-label { color: var(--text-muted); font-weight: 600; }
.cliente-card-chip .badge { font-size: 0.72rem; }
.cliente-card-stats {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 6px; margin-top: 12px; padding: 11px 0 10px;
    border-top: 1px dashed var(--border); border-bottom: 1px dashed var(--border);
    text-align: center;
}
.cliente-card-stat .stat-val { font-weight: 800; font-size: 1.02rem; color: var(--text); white-space: nowrap; }
.cliente-card-stat .stat-lbl { font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-top: 3px; }
.cliente-card-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.cliente-card-actions .btn { min-width: 0; white-space: nowrap; padding-left: 4px; padding-right: 4px; }

/* ============ PANEL: MESAS ============ */
.zona-title {
    color: var(--brand);
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    padding-bottom: 5px;
    margin: 20px 0 10px;
    font-size: 1rem;
}
.mesa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.mesa-card {
    position: relative;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.12s;
    text-align: center;
}
.mesa-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.08); }
.mesa-card.free { border-top: 4px solid var(--success); }
.mesa-card.occupied { border-top: 4px solid #f39c12; }
.mesa-card.calling { border-top: 4px solid var(--danger); animation: pulse 1s infinite; }
.mesa-card.paying { border-top: 4px solid var(--blue); }
@keyframes pulse { 50% { background: #fdecec; } }
@keyframes llamandoPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
@keyframes mesaOrderPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(243, 156, 18, 0); }
  50% { transform: scale(1.03); box-shadow: 0 0 0 6px rgba(243, 156, 18, 0.18); }
}
@keyframes mesaPendingShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}
.mesa-card.mesa-has-order { animation: mesaOrderPulse 1.8s ease-in-out infinite; }
.mesa-card.mesa-has-pending {
  border-top-width: 6px;
  animation: mesaPendingShake 1.2s ease-in-out infinite, mesaOrderPulse 1.8s ease-in-out infinite;
}
.mesa-card.mesa-has-pending .mesa-num { color: var(--brand); }
.mesa-order-tag {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  background: #fff3e0;
  color: #b3541e;
}
.mesa-settings-btn {
    position: absolute;
    top: 6px;
    right: 8px;
    border: none;
    background: transparent;
    font-size: 1.1rem;
    color: #aaa;
    cursor: pointer;
}
.mesa-num { font-weight: 800; font-size: 1rem; }
.mesa-estado { font-size: 0.74rem; color: var(--text-muted); margin-top: 2px; }
.zone-container.drag-over { outline: 2px dashed var(--brand); outline-offset: 4px; border-radius: 12px; }

.zone-admin-row { display: flex; align-items: center; gap: 8px; padding: 8px; background: #f7f4ee; border-radius: 8px; margin-bottom: 8px; }

.qr-box { text-align: center; padding: 12px; background: #faf8f3; border-radius: 10px; }
.qr-label { font-weight: 800; margin-top: 8px; }
.qr-sub { font-size: 0.75rem; color: var(--text-muted); }

.table-order { background: #f5f5f5; padding: 8px; border-radius: 6px; margin-bottom: 6px; }
.payment-box {
    margin-top: 14px;
    padding: 12px;
    background: var(--surface2);
    border-radius: 8px;
    border: 1px solid var(--border);
}

/* ============ PANEL: PEDIDOS ============ */
.filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-tab {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 20px;
    padding: 6px 14px;
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
}
.filter-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.pedido-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 14px;
}
.pedido-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.pedido-title { font-weight: 700; font-size: 0.95rem; line-height: 1.4; }
.pedido-customer { font-weight: 400; color: #666; font-size: 0.88rem; }
.pedido-phone { display: inline-flex; align-items: center; background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; border-radius: 4px; padding: 1px 6px; font-size: 0.75rem; font-weight: 600; margin-left: 4px; }
.pedido-meta { font-size: 0.74rem; color: var(--text-muted); margin-top: 2px; }
.pedido-items { list-style: none; padding: 0; margin: 6px 0; }
.pedido-item { line-height: 1.5; font-size: 0.88rem; }
.pedido-total { margin-top: 8px; }
.pedido-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }

.src-badge { border-radius: 4px; padding: 1px 6px; font-size: 0.78rem; font-weight: 600; }
.src-delivery { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.src-takeaway { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }

.notes-box {
    margin-top: 10px;
    padding: 10px;
    background: #FFF8DC;
    border-left: 4px solid var(--brand);
    border-radius: 4px;
    font-size: 0.88rem;
    color: var(--text);
    line-height: 1.4;
}

/* ============ PANEL: COCINA ============ */
.cocina-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.cocina-ticket {
    background: #fff;
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.cocina-ticket.listo { border-color: var(--success); background: #f2fbf5; }
.ticket-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.ticket-mesa { font-size: 1.25rem; font-weight: 800; color: var(--brand); }
.ticket-time { font-size: 0.72rem; color: var(--text-muted); }
.ticket-notes { margin-bottom: 7px; padding: 6px; background: #FFF8DC; border-left: 3px solid var(--brand); border-radius: 4px; font-size: 0.78rem; }
.ticket-items { list-style: none; padding: 0; margin: 6px 0; }
.ticket-items li { font-size: 0.95rem; font-weight: 600; padding: 3px 0; border-bottom: 1px dotted #eee; }

/* ============ PANEL: MENÚ ============ */
.menu-product-cell { display: flex; align-items: center; gap: 10px; }
.menu-product-cell img { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; cursor: pointer; }
.menu-emoji-cell { width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; background: var(--surface2); border-radius: 8px; font-size: 1.3rem; }

/* ============ PANEL: ADMIN ============ */
.admin-layout { display: grid; grid-template-columns: 200px 1fr; gap: 20px; }
.sidebar { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 10px; align-self: start; position: sticky; top: 80px; }
.sidebar-item {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    padding: 11px 12px;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
}
.sidebar-item:hover { background: var(--surface2); }
.sidebar-item.active-item { background: var(--brand); color: #fff; }
.admin-content { min-width: 0; }

.logo-dropzone {
    display: flex;
    align-items: center;
    gap: 14px;
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    background: var(--surface2);
    font-size: 0.85rem;
    color: var(--text-muted);
}
.logo-dropzone img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; }
.color-row { display: flex; align-items: center; gap: 12px; }
.color-row input[type="color"] { width: 48px; height: 38px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; background: #fff; }

/* ============ CLIENTE ============ */
.client-body { background: var(--bg); }
.client-outer { max-width: 396px; margin: 0 auto; }

.loader {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s;
}
.loader-content { text-align: center; }
      .loader-content img { max-width: 260px; max-height: 90px; width: auto; height: auto; border-radius: 12px; object-fit: contain; margin-bottom: 20px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.loader-content div:last-child { margin-top: 20px; font-weight: 600; font-size: 1.1rem; color: var(--text); padding: 0 20px; }
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #E0D8CC;
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.phone-shell { min-height: 100vh; }
.client-scroll { overflow-x: clip; }
.client-wrap { padding: 16px 16px 0; }

.client-header { text-align: center; margin-bottom: 12px; }
.client-logo-img {
    max-width: 220px;
    width: auto;
    height: auto;
    max-height: 58px;
    object-fit: contain;
    border-radius: 12px;
    margin-bottom: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.client-logo-text { font-size: 1.15rem; font-weight: 800; color: var(--text); }
.client-mesa-info {
    display: inline-block;
    margin-top: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--brand);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 14px;
}

.waiter-btn {
    width: 100%;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 13px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 12px;
    font-family: var(--font);
}
.waiter-btn:disabled { opacity: 0.6; }

#myOrdersWidget {
    background: #fff;
    border-radius: 12px;
    padding: 13px;
    margin-bottom: 12px;
    display: none;
    border-left: 4px solid var(--brand);
}
.my-orders-head { font-weight: 600; margin-bottom: 7px; font-size: 0.92rem; }
.my-order-item { padding: 8px 0; }
.my-order-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.my-order-head strong { color: var(--text); font-size: 0.88rem; }
.order-status-badge { font-size: 0.7rem; background: #f0f0f0; padding: 2px 6px; border-radius: 4px; font-weight: 600; }
.my-order-items { color: var(--text-muted); font-size: 0.8rem; line-height: 1.4; }
.my-orders-total {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}
#myOrdersTotal { color: var(--brand); }

#searchBar { padding: 6px 0 4px; }
#searchBar input {
    width: 100%;
    padding: 11px 40px 11px 38px;
    border-radius: 12px;
    border: 2px solid var(--border);
    background: #fff;
    font-size: 0.95rem;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    font-family: var(--font);
}
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 1rem; pointer-events: none; }
#searchClearBtn {
    display: none;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: #64748b;
    padding: 4px;
    line-height: 1;
}
#searchResultCount { font-size: 0.75rem; color: #64748b; margin-top: 3px; padding-left: 2px; min-height: 14px; }

#categoriesFilter, .categories-scroll {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    padding: 12px 16px;
}
#categoriesFilter > div { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.category-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    border-radius: 999px;
    padding: 9px 15px;
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    min-height: 40px;
}
.category-btn .cat-emoji { font-size: 1.05rem; }
.category-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.cat-pill {
    flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 15px; border-radius: 999px; border: 1px solid var(--border);
    background: #fff; font-size: 0.85rem; font-weight: 600; color: var(--text);
    cursor: pointer; white-space: nowrap; min-height: 40px; transition: 0.15s;
}
.cat-pill.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.cats-swipe-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 16px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--brand);
}
.cats-swipe-hint::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border), transparent);
}

.menu-section { margin-bottom: 6px; }
.menu-section-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text);
    padding: 10px 2px 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.menu-section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 10px;
}
.menu-item-img {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--surface2);
    border: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.menu-item-info { flex: 1; cursor: pointer; min-width: 0; }
.menu-item-name { font-weight: 700; font-size: 0.95rem; line-height: 1.3; }
.menu-item-desc { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }
.menu-item-price { font-weight: 800; color: var(--brand); margin-top: 3px; font-size: 0.92rem; }

.add-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--brand);
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.add-btn:disabled { background: #d8d0c4; box-shadow: none; }
.qty-control { display: flex; align-items: center; gap: 3px; flex-shrink: 0; }
.qty-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid var(--brand);
    background: #fff;
    color: var(--brand);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
}
.qty-control span { min-width: 30px; text-align: center; font-weight: 700; font-size: 1rem; }

.menu-empty, .search-empty { text-align: center; padding: 30px 20px; color: var(--text-muted); }

/* Carrito fijo */
#cartWidget {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 396px;
    z-index: 300;
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -3px 16px rgba(0,0,0,0.12);
    padding: 10px 14px 12px;
    display: none;
}
#cartWidget.visible { display: block; }
.cart-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.cart-head > span:first-child { font-weight: 700; font-size: 0.9rem; }
#cartBadge {
    display: none;
    background: var(--brand);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    border-radius: 20px;
    padding: 2px 8px;
}
#cartItems { font-size: 0.82rem; color: #444; margin-bottom: 6px; max-height: 80px; overflow-y: auto; }
.cart-item-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 2px 0; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-info > div:first-child { display: flex; justify-content: space-between; gap: 8px; }
.cart-remove {
    flex-shrink: 0;
    width: 20px; height: 20px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #999;
    font-size: 0.7rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: flex; align-items: center; justify-content: center;
}
.cart-remove:hover { background: #fee2e2; color: #d33; }
.cart-empty { color: #64748b; font-size: 0.85rem; }
.cart-breakdown { border-top: 1px dashed var(--border); padding-top: 6px; }
.cart-row { display: flex; justify-content: space-between; color: #666; font-size: 0.78rem; margin-bottom: 1px; }
.cart-row.muted { font-size: 0.72rem; }
.cart-row.total { font-weight: 800; font-size: 0.95rem; color: var(--brand); margin-bottom: 8px; }
#cartWidget .btn { width: 100%; padding: 11px; }
#cartSpacer { height: 0; }

/* Selector de propina (el cliente elige en la ventana del pedido) */
.tip-selector { margin: 2px 0 16px; text-align: left; }
.tip-selector .ts-label { display: block; font-weight: 600; font-size: 0.85rem; color: var(--text); margin-bottom: 6px; }
.tip-options { display: flex; gap: 8px; flex-wrap: wrap; }
.tip-opt {
    border: 1.5px solid var(--border); background: #fff; color: var(--text);
    border-radius: 999px; padding: 8px 15px; font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: 0.15s;
}
.tip-opt.active { border-color: var(--brand); background: var(--brand); color: #fff; }

/* Modal cliente */
#clientModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}
#clientModal.open { display: flex; }
#clientModalContent {
    background: #fff;
    padding: 24px;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
}
.modal-header-inner { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-close-btn { background: transparent; border: none; font-size: 1.5rem; cursor: pointer; color: #666; }
.modal-body-inner { text-align: center; }
.modal-subtitle { font-size: 1.05rem; margin-bottom: 15px; color: var(--text); }
.modal-img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 16px;
    display: block;
}
.modal-emoji {
    height: 100px;
    background: #f5f0e8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}
.modal-category {
    font-size: 0.72rem;
    color: var(--brand);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}
.modal-title-product { font-size: 1.15rem; font-weight: 800; color: #1a1a1a; margin-bottom: 8px; line-height: 1.3; }
.modal-desc { font-size: 0.9rem; color: #555; line-height: 1.65; }
.modal-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f9f7f3;
    border-radius: 12px;
    padding: 10px 14px;
    margin-top: 14px;
}
.modal-qty { display: flex; align-items: center; gap: 0; }
.qty-round {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.qty-round-minus { border: 2px solid var(--brand); background: #fff; color: var(--brand); }
.qty-round-plus { border: none; background: var(--brand); color: #fff; }
.modal-qty span { min-width: 36px; text-align: center; font-weight: 700; font-size: 1.1rem; }
.modal-price { font-weight: 800; font-size: 1.1rem; color: var(--brand); }
.modal-unavailable { text-align: center; padding: 12px; color: #64748b; font-size: 0.9rem; margin-top: 12px; }
.modal-back {
    width: 100%;
    margin-top: 12px;
    padding: 11px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: #666;
    font-size: 0.88rem;
    cursor: pointer;
    font-weight: 600;
    font-family: var(--font);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .admin-layout { grid-template-columns: 1fr; }
    .sidebar { position: static; display: flex; gap: 6px; overflow-x: auto; }
    .sidebar-item { white-space: nowrap; width: auto; }
    .nav-tabs { display: none; }
    .hamburger { display: flex; }
    .table-wrap-cli { display: none; }
    .clientes-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
}
@media (max-width: 760px) {
    .view-header { align-items: flex-start; flex-direction: column; }
    .view-title { font-size: 1.2rem; }
}
@media (max-width: 520px) {
    .page { padding: 14px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .form-grid { grid-template-columns: 1fr; }
    .cliente-card-stats { grid-template-columns: repeat(2, 1fr); gap: 10px 6px; }
}


/* ============ INGREDIENTES (productos) ============ */
.modal-section-title { font-weight: 700; font-size: 0.95rem; color: var(--text); margin: 14px 0 8px; }
.ing-list { display: flex; flex-direction: column; gap: 6px; }
.ing-row {
    display: flex; align-items: center; gap: 10px; padding: 9px 11px;
    border: 1px solid var(--border); border-radius: 10px; background: var(--surface2);
}
.ing-row input { width: 18px; height: 18px; accent-color: var(--brand); flex-shrink: 0; }
.ing-row .ing-name { flex: 1; font-size: 0.9rem; }
.ing-row .ing-price { font-weight: 700; color: var(--brand); font-size: 0.85rem; }
.cart-item-sub { font-size: 0.75rem; color: var(--text-muted); }
.cart-item-extras { font-size: 0.75rem; color: var(--text-muted); }
.pedido-item-extras { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; padding-left: 14px; }

/* ============ BANNERS CARRUSEL ============ */
#bannersCarousel { position: relative; margin: 4px 0 10px; aspect-ratio: 1 / 1; border-radius: 16px; overflow: hidden; }
#deliveryBanners { position: relative; margin: 6px 16px; aspect-ratio: 1 / 1; border-radius: 16px; overflow: hidden; }
.banner-track {
    display: flex;
    width: 100%;
    transition: transform 0.5s ease;
    will-change: transform;
}
.banner-slide {
    flex: 0 0 100%;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
}
.banner-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner-emoji {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    font-size: 3.2rem; background: linear-gradient(135deg, var(--brand), var(--brand-dark));
}
.banner-title {
    position: absolute; left: 12px; bottom: 10px; max-width: 72%;
    background: rgba(0,0,0,0.55); color: #fff; padding: 5px 12px; border-radius: 999px;
    font-weight: 700; font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.banner-tag {
    position: absolute; right: 12px; bottom: 10px; background: #fff; color: #2C2C2C;
    padding: 5px 12px; border-radius: 999px; font-weight: 600; font-size: 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.banner-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(0,0,0,0.45); color: #fff; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 700; line-height: 1; z-index: 5;
    user-select: none; -webkit-user-select: none; padding: 0;
}
.banner-arrow.prev { left: 8px; }
.banner-arrow.next { right: 8px; }
.banner-arrow:hover { background: rgba(0,0,0,0.7); }
