:root {
    --primary-color: #ff8c00;
    --primary-hover: #e07b00;
    --dark-bg: #0b1726;
    --sidebar-bg: #0f1e33;
    --card-bg: #ffffff;
    --text-color: #333333;
    --light-bg: #f4f6f9;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: system-ui, -apple-system, sans-serif; }
body { display: flex; background: var(--light-bg); color: var(--text-color); min-height: 100vh; }

/* SIDEBAR & NAV */
.sidebar { width: 260px; background: var(--sidebar-bg); color: #fff; display: flex; flex-direction: column; position: fixed; height: 100vh; z-index: 100; }
.brand { padding: 25px 20px; text-align: center; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.brand .logo-icon { font-size: 2.2rem; color: var(--primary-color); }
.brand h2 span { color: var(--primary-color); }
.brand p { font-size: 0.65rem; color: #a0b2ce; margin-top: 4px; }
.nav-menu { display: flex; flex-direction: column; padding: 15px 0; overflow-y: auto; flex-grow: 1; }
.nav-link { color: #cbd5e1; text-decoration: none; padding: 12px 25px; display: flex; align-items: center; gap: 15px; transition: 0.2s; }
.nav-link:hover, .nav-link.active { background: var(--primary-color); color: #fff; border-radius: 0 25px 25px 0; margin-right: 15px; }

.sidebar-footer { padding: 15px; text-align: center; }
.admin-open-btn { background: transparent; border: 1px solid #4a607a; color: #a0b2ce; padding: 8px 15px; border-radius: 20px; cursor: pointer; width: 100%; transition: 0.2s; }
.admin-open-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* MAIN CONTENT */
.main-content { margin-left: 260px; flex-grow: 1; display: flex; flex-direction: column; }
.top-header { background: #fff; padding: 15px 30px; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 90; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.search-bar { display: flex; align-items: center; background: var(--light-bg); padding: 8px 15px; border-radius: 20px; width: 300px; }
.search-bar input { border: none; background: transparent; outline: none; margin-left: 10px; width: 100%; }
.cart-btn { background: var(--primary-color); color: white; border: none; padding: 10px 18px; border-radius: 20px; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.cart-count { background: white; color: var(--primary-color); font-weight: bold; border-radius: 50%; padding: 2px 7px; font-size: 0.8rem; }

/* HERO */
.hero-banner { background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('https://images.unsplash.com/photo-1565680018434-b513d5e5fd47?auto=format&fit=crop&w=1000&q=75') center/cover; height: 200px; margin: 20px 30px; border-radius: 15px; display: flex; align-items: center; justify-content: flex-end; padding: 30px; color: white; }
.hero-text { text-align: right; }
.hero-text h1 { font-size: 1.8rem; color: #ffe8d6; }

/* MENU GRID */
.menu-container { padding: 10px 30px 40px; display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 25px; }
.category-card { background: white; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.05);
scroll-margin-top: 90px; }
.category-header { display: flex; align-items: center; gap: 10px; padding: 15px 20px; border-bottom: 2px solid var(--light-bg); }
.category-header i { font-size: 1.3rem; color: var(--primary-color); }
.category-img { width: 100%; height: 150px; object-fit: cover; }
.product-list { padding: 15px 20px; }
.product-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px dotted #e0e0e0; }
.product-name { font-weight: 600; font-size: 0.95rem; }
.product-price { font-weight: bold; color: var(--primary-color); margin-left: 10px; }
.add-btn { background: #eef2f5; color: var(--primary-color); border: none; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-weight: bold; }
.add-btn:hover { background: var(--primary-color); color: white; }

/* MODALES (CARRITO Y ADMIN) */
.cart-modal, .admin-modal { position: fixed; top: 0; right: -420px; width: 400px; height: 100vh; background: white; z-index: 1000; transition: right 0.3s ease; display: flex; flex-direction: column; box-shadow: -5px 0 25px rgba(0,0,0,0.15); }
.cart-modal.open { right: 0; }
.admin-modal { right: auto; left: -100%; width: 100%; max-width: 600px; transition: left 0.3s ease; }
.admin-modal.open { left: 0; }

.cart-header, .admin-header { background: var(--dark-bg); color: white; padding: 20px; display: flex; justify-content: space-between; align-items: center; }
.close-btn { background: none; border: none; color: white; font-size: 1.8rem; cursor: pointer; }
.cart-body, .admin-body { padding: 20px; flex-grow: 1; overflow-y: auto; }
.cart-item { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.qty-controls { display: flex; gap: 8px; margin-top: 5px; }
.qty-btn { background: #ddd; border: none; width: 24px; height: 24px; border-radius: 4px; cursor: pointer; }
.cart-footer { padding: 20px; background: #f9f9f9; border-top: 1px solid #eee; }
.cart-total { display: flex; justify-content: space-between; font-size: 1.2rem; margin-bottom: 15px; }
.whatsapp-send-btn { width: 100%; background: #25d366; color: white; border: none; padding: 12px; border-radius: 8px; font-weight: bold; cursor: pointer; display: flex; justify-content: center; gap: 10px; }

/* ADMIN CONTROLS */
.admin-actions { padding: 15px 20px; background: #f0f4f8; display: flex; gap: 10px; flex-wrap: wrap; }
.btn-primary, .btn-secondary, .btn-danger { padding: 8px 12px; border-radius: 6px; border: none; cursor: pointer; font-size: 0.85rem; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.btn-primary { background: var(--primary-color); color: white; }
.btn-secondary { background: #334155; color: white; }
.btn-danger { background: #e11d48; color: white; }
.admin-item-row { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; background: #f8fafc; padding: 10px; border-radius: 8px; border: 1px solid #e2e8f0; }
.admin-item-row input[type="text"] { flex-grow: 1; padding: 6px; border: 1px solid #cbd5e1; border-radius: 4px; }
.admin-item-row input[type="number"] { width: 80px; padding: 6px; border: 1px solid #cbd5e1; border-radius: 4px; }
/* Botón pequeño para cerrar sesión en el Admin Header */
.btn-danger-sm {
    background: #e11d48;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 10px;
    font-size: 0.9rem;
}

.btn-danger-sm:hover {
    background: #be123c;
}
/* FOOTER */
.main-footer { background: var(--dark-bg); color: white; padding: 20px 30px; display: flex; justify-content: space-between; margin-top: auto; }
.footer-info { display: flex; align-items: center; gap: 15px; }
.footer-info i { color: var(--primary-color); font-size: 1.4rem; }

/* RESPONSIVE */
@media (max-width: 900px) {
    body { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: relative; }
    .nav-menu { flex-direction: row; overflow-x: auto; }
    .main-content { margin-left: 0; }
    .hero-banner { justify-content: center; }
    .hero-text { text-align: center; }
    .admin-modal { width: 100%; }
}