:root {
            --verde: #00A86B;
            --verde-dark: #007a4d;
            --verde-light: #e6f7f1;
            --naranja: #FF6B35;
            --naranja-light: #fff1ec;
            --rojo: #E53935;
            --rojo-light: #ffebee;
            --bg: #F5F3EF;
            --surface: #ffffff;
            --border: #ECEAE5;
            --text: #1C1C1C;
            --text-muted: #7A7570;
            --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
            --shadow-md: 0 6px 24px rgba(0,0,0,0.10);
            --shadow-lg: 0 16px 48px rgba(0,0,0,0.14);
            --radius: 18px;
            --radius-sm: 10px;
        }

        *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

        body {
            font-family: 'Nunito', sans-serif;
            background: var(--bg);
            color: var(--text);
            min-height: 100vh;
        }

        .hidden { display: none !important; }

        /* ── TOP BAR ── */
        .top-bar {
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 0 24px;
            height: 66px;
            background: var(--surface);
            border-bottom: 1px solid var(--border);
            position: sticky;
            top: 0;
            z-index: 500;
            box-shadow: var(--shadow-sm);
        }

        .logo {
            display: flex;
            align-items: center;
            gap: 8px;
            text-decoration: none;
            flex-shrink: 0;
        }
        .logo img { height: 36px; border-radius: 8px; object-fit: cover; }
        .logo-text {
            font-family: 'Syne', sans-serif;
            font-size: 17px;
            font-weight: 800;
            color: var(--verde);
            letter-spacing: -0.3px;
        }

        .search-wrap { flex: 1; position: relative; }
        .search-wrap input {
            width: 100%;
            padding: 10px 16px 10px 40px;
            border-radius: 50px;
            border: 1.5px solid var(--border);
            background: var(--bg);
            font-family: 'Nunito', sans-serif;
            font-size: 14px;
            color: var(--text);
            outline: none;
            transition: border-color 0.2s, box-shadow 0.2s;
        }
        .search-wrap input:focus {
            border-color: var(--verde);
            box-shadow: 0 0 0 3px rgba(0,168,107,0.12);
        }
        .search-wrap::before {
            position: absolute;
            left: 13px; top: 50%;
            transform: translateY(-50%);
            font-size: 14px;
            pointer-events: none;
        }

        .nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
        .btn-home {
            background: var(--bg);
            border: 1.5px solid var(--border);
            border-radius: var(--radius-sm);
            padding: 8px 14px; font-size: 18px;
            cursor: pointer;
            transition: background 0.2s, transform 0.15s;
            line-height: 1;
        }
        .btn-home:hover { background: var(--verde-light); transform: translateY(-1px); }

        .btn-cart {
            position: relative;
            background: var(--verde); border: none;
            border-radius: 50px; padding: 9px 18px 9px 14px;
            font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 14px;
            color: white; cursor: pointer;
            display: flex; align-items: center; gap: 7px;
            transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
            box-shadow: 0 4px 14px rgba(0,168,107,0.3);
        }
        .btn-cart:hover { background: var(--verde-dark); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,168,107,0.35); }
        #cart-count {
            background: var(--naranja); color: white;
            border-radius: 50px; padding: 1px 7px;
            font-size: 11px; font-weight: 800;
            min-width: 20px; text-align: center;
        }

        .btn-perfil {
            background: var(--bg);
            border: 1.5px solid var(--border);
            border-radius: var(--radius-sm);
            padding: 8px 14px; font-size: 18px;
            cursor: pointer;
            transition: background 0.2s, transform 0.15s;
            line-height: 1;
        }
        .btn-perfil:hover { background: var(--verde-light); transform: translateY(-1px); }

        /* ── HOME VIEW ── */
        .container { max-width: 1200px; margin: 0 auto; padding: 32px 24px; }

        /* ══════════════════════════════════════════
           HERO — imagen de fondo + verde siempre
           La imagen se inyecta via JS (hero-bg.js)
        ══════════════════════════════════════════ */
        .home-hero {
            position: relative;
            border-radius: 24px;
            padding: 44px 40px 40px;
            margin-bottom: 36px;
            color: white;
            overflow: hidden;
            min-height: 190px;
            display: flex;
            align-items: center;
        }

        /* Capa 1: imagen de fondo */
        .home-hero::before {
            content: '';
            position: absolute;
            inset: 0;
            background-image: var(--hero-img);
            background-size: cover;
            background-position: center 40%;
            border-radius: 24px;
            transition: transform 0.6s ease;
        }
        .home-hero:hover::before { transform: scale(1.03); }

        /* Capa 2: gradiente — siempre con toque verde al final */
        .home-hero::after {
            content: '';
            position: absolute;
            inset: 0;
            background: var(--hero-gradient);
            border-radius: 24px;
        }

        /* Contenido encima de las capas */
        .home-hero > * { position: relative; z-index: 2; }

        .home-hero h2 {
            font-family: 'Syne', sans-serif;
            font-size: 32px;
            font-weight: 800;
            line-height: 1.2;
            margin-bottom: 10px;
            text-shadow: 0 2px 12px rgba(0,0,0,0.3);
        }
        .home-hero p {
            font-size: 15px;
            opacity: 0.92;
            font-weight: 600;
            text-shadow: 0 1px 6px rgba(0,0,0,0.25);
        }

        /* ── CARDS LOCALES ── */
        .grid-locales {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
            gap: 20px;
        }

        .card-local {
            background: var(--surface);
            border-radius: var(--radius);
            overflow: hidden;
            cursor: pointer;
            border: 1px solid var(--border);
            box-shadow: var(--shadow-sm);
            transition: transform 0.28s cubic-bezier(0.4,0,0.2,1), box-shadow 0.28s;
            animation: fadeInUp 0.5s ease both;
        }
        .card-local:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }

        .card-img-wrap { position: relative; height: 148px; overflow: hidden; }
        .card-img-wrap img {
            width: 100%; height: 100%;
            object-fit: cover;
            transition: transform 0.4s ease;
        }
        .card-local:hover .card-img-wrap img { transform: scale(1.06); }
        .card-overlay {
            position: absolute; inset: 0;
            background: linear-gradient(to top, rgba(0,0,0,0.35) 0%, transparent 60%);
        }
        .card-badge {
            position: absolute; top: 12px; right: 12px;
            background: white; border-radius: 50px;
            padding: 4px 10px; font-size: 18px;
            box-shadow: var(--shadow-sm); line-height: 1;
        }

        .card-info { padding: 16px 18px 18px; }
        .card-header-row {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 5px;
        }
        .card-rating {
            font-size: 12px; font-weight: 700;
            background: #FFF8E1; color: #E65100;
            border-radius: 50px; padding: 3px 9px;
            white-space: nowrap;
            display: flex; align-items: center; gap: 3px;
        }
        .card-desc {
            font-size: 13px; color: var(--text-muted);
            margin-bottom: 12px; line-height: 1.45;
        }
        .card-meta { display: flex; gap: 8px; flex-wrap: wrap; }

        /* ══ CHIPS MEJORADOS ══ */
        .meta-chip {
            font-size: 11px; font-weight: 700;
            border-radius: 50px; padding: 4px 11px;
            display: inline-flex; align-items: center; gap: 4px;
            letter-spacing: 0.2px;
            background: #F0EDEA; color: #5A5550;
            border: 1px solid #DDD9D4;
        }

        /* Abierto — verde vibrante con pulso */
        .meta-chip.open {
            background: linear-gradient(135deg, #00C67A, #00A86B);
            color: white; border: none;
            box-shadow: 0 2px 10px rgba(0,168,107,0.4);
            animation: pulseOpen 2.4s ease-in-out infinite;
        }
        .meta-chip.open::before {
            content: '';
            display: inline-block;
            width: 7px; height: 7px;
            background: white; border-radius: 50%;
            opacity: 0.9; flex-shrink: 0;
            animation: dotPulse 1.8s ease-in-out infinite;
        }

        /* Cerrado — rojo */
        .meta-chip.closed {
            background: linear-gradient(135deg, #ef5350, #e53935);
            color: white; border: none;
            box-shadow: 0 2px 10px rgba(229,57,53,0.3);
        }
        .meta-chip.closed::before {
            content: '';
            display: inline-block;
            width: 7px; height: 7px;
            background: white; border-radius: 50%;
            opacity: 0.8; flex-shrink: 0;
        }

        @keyframes pulseOpen {
            0%, 100% { box-shadow: 0 2px 10px rgba(0,168,107,0.4); }
            50%       { box-shadow: 0 2px 20px rgba(0,168,107,0.65); }
        }
        @keyframes dotPulse {
            0%, 100% { transform: scale(1);   opacity: 0.9; }
            50%       { transform: scale(1.5); opacity: 1;   }
        }

        /* ── LOCAL HERO ── */
        .hero-banner {
            height: 230px; border-radius: 20px;
            position: relative;
            background-size: cover; background-position: center;
            overflow: hidden; margin-bottom: 20px;
            box-shadow: var(--shadow-md);
        }
        .hero-overlay {
            position: absolute; inset: 0;
            background: linear-gradient(to top, rgba(0,0,0,0.75) 30%, rgba(0,0,0,0.1) 100%);
        }
        .hero-text {
            position: absolute; bottom: 0; left: 0; right: 0;
            padding: 20px 24px; color: white; z-index: 2;
        }
        .hero-text h1 {
            font-family: 'Syne', sans-serif;
            font-size: 26px; font-weight: 800; margin-bottom: 6px;
        }
        .hero-meta { display: flex; gap: 14px; font-size: 13px; opacity: 0.9; }
        .hero-meta span { font-weight: 600; }

        /* ── CATEGORÍAS ── */
        .categories-wrapper {
            overflow-x: auto; white-space: nowrap;
            padding: 4px 0 14px; scrollbar-width: none;
        }
        .categories-wrapper::-webkit-scrollbar { display: none; }
        .categories-nav { display: flex; gap: 8px; }
        .cat-btn {
            background: var(--surface);
            border: 1.5px solid var(--border);
            padding: 9px 18px; border-radius: 50px;
            font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 13px;
            cursor: pointer; transition: all 0.2s;
            color: var(--text-muted); white-space: nowrap;
            display: inline-flex; align-items: center; gap: 6px;
        }
        .cat-btn.active {
            background: var(--verde); color: white;
            border-color: var(--verde);
            box-shadow: 0 4px 12px rgba(0,168,107,0.25);
        }
        .cat-btn:hover:not(.active) { background: var(--bg); color: var(--text); }

        /* ── PRODUCTOS ── */
        .products-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 14px; margin-top: 4px;
        }
        .product-card {
            background: var(--surface); border-radius: var(--radius-sm);
            padding: 14px; display: flex; gap: 14px; align-items: center;
            border: 1px solid var(--border); box-shadow: var(--shadow-sm);
            transition: transform 0.2s, box-shadow 0.2s;
            animation: fadeInUp 0.4s ease both;
        }
        .product-card:hover { transform: translateY(-3px) translateX(2px); box-shadow: var(--shadow-md); }

        .product-img-wrap {
            flex-shrink: 0; width: 76px; height: 76px;
            border-radius: var(--radius-sm); overflow: hidden;
        }
        .product-img-wrap img {
            width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s;
        }
        .product-card:hover .product-img-wrap img { transform: scale(1.08); }

        .product-info { flex: 1; min-width: 0; }
        .product-info h4 {
            font-size: 15px; font-weight: 700; margin-bottom: 3px;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .product-cat {
            font-size: 12px; color: var(--text-muted);
            text-transform: capitalize; margin-bottom: 10px;
            display: flex; align-items: center; gap: 4px;
        }
        .product-footer { display: flex; justify-content: space-between; align-items: center; }
        .product-price { font-size: 17px; font-weight: 800; color: var(--verde); }

        .btn-add {
            background: var(--verde); color: white; border: none;
            padding: 7px 14px; border-radius: 50px;
            font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 13px;
            cursor: pointer;
            transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
            display: flex; align-items: center; gap: 5px;
            box-shadow: 0 4px 10px rgba(0,168,107,0.25);
        }
        .btn-add span { font-size: 16px; font-weight: 800; line-height: 1; }
        .btn-add:hover { background: var(--verde-dark); transform: scale(1.06); box-shadow: 0 6px 16px rgba(0,168,107,0.35); }
        .btn-add:active { transform: scale(0.97); }

        /* ── MODAL ── */
        .modal-overlay {
            position: fixed; inset: 0;
            background: rgba(0,0,0,0.55);
            display: flex; align-items: flex-end; justify-content: center;
            z-index: 800; backdrop-filter: blur(3px);
        }
        .modal-content {
            background: var(--surface); width: 100%; max-width: 520px;
            border-radius: 24px 24px 0 0;
            padding: 12px 24px 32px;
            animation: slideUp 0.38s cubic-bezier(0.4,0,0.2,1);
            max-height: 90vh; overflow-y: auto;
        }
        .modal-handle {
            width: 40px; height: 4px; background: var(--border);
            border-radius: 4px; margin: 0 auto 18px;
        }
        .modal-product-header {
            display: flex; gap: 14px; align-items: center;
            margin-bottom: 18px; padding-bottom: 18px;
            border-bottom: 1px solid var(--border);
        }
        .modal-product-img {
            width: 68px; height: 68px;
            border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0;
        }
        .modal-product-header h2 {
            font-family: 'Syne', sans-serif; font-size: 20px; font-weight: 800; margin-bottom: 4px;
        }
        .modal-price { font-size: 18px; font-weight: 800; color: var(--verde); }

        .option-group { margin-bottom: 16px; }
        .option-group h3 {
            font-family: 'Syne', sans-serif; font-size: 13px; font-weight: 700;
            text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted);
            margin-bottom: 10px; padding-bottom: 6px;
            border-bottom: 1px solid var(--border);
            display: flex; align-items: center; gap: 6px;
        }
        .option-item {
            display: flex; justify-content: space-between; align-items: center; padding: 8px 0;
        }
        .option-label { font-weight: 600; font-size: 14px; }
        .toggle-group {
            display: flex; background: var(--bg);
            border-radius: 50px; padding: 3px; gap: 3px;
        }
        .btn-toggle {
            border: none; background: transparent; border-radius: 50px;
            padding: 5px 14px; font-family: 'Nunito', sans-serif;
            font-weight: 700; font-size: 13px; cursor: pointer;
            color: var(--text-muted); transition: all 0.18s;
        }
        .btn-toggle.active {
            background: var(--surface); color: var(--text);
            box-shadow: 0 1px 4px rgba(0,0,0,0.12);
        }
        .btn-guardar {
            background: var(--verde); color: white; width: 100%; padding: 16px;
            border-radius: var(--radius-sm); border: none;
            font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 15px;
            margin-top: 20px; cursor: pointer;
            box-shadow: 0 6px 20px rgba(0,168,107,0.3);
            transition: background 0.2s, transform 0.15s;
            display: flex; align-items: center; justify-content: center; gap: 8px;
        }
        .btn-guardar:hover { background: var(--verde-dark); transform: translateY(-1px); }

        /* ── TICKET ── */
        .ticket-nota {
            position: fixed; bottom: 28px; right: 28px;
            background: #FFE566; width: 230px; padding: 18px 18px 16px;
            box-shadow: 6px 8px 0px rgba(0,0,0,0.18), 2px 3px 0 rgba(0,0,0,0.08);
            transform: rotate(-2.5deg); z-index: 900;
            animation: popIn 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }
        .ticket-header {
            font-size: 13px; font-weight: 700; text-align: center;
            border-bottom: 1.5px dashed rgba(0,0,0,0.25);
            padding-bottom: 7px; margin-bottom: 10px;
            letter-spacing: 0.5px; color: #333; text-transform: uppercase;
            display: flex; align-items: center; justify-content: center; gap: 6px;
        }
        .ticket-body {
            display: flex; justify-content: space-between; align-items: flex-start;
            margin-bottom: 6px; position: relative; z-index: 1;
        }
        .ticket-body strong { font-size: 19px; font-weight: 700; color: #1a1a1a; line-height: 1.2; max-width: 140px; }
        .ticket-body span   { font-size: 19px; font-weight: 700; color: #1a4d1a; white-space: nowrap; }
        .ticket-msg {
            font-size: 15px; color: rgba(0,0,0,0.5); margin-bottom: 12px;
            line-height: 1.3; position: relative; z-index: 1;
            display: flex; align-items: center; gap: 5px;
        }
        .btn-confirmar-nota {
            width: 100%; padding: 9px;
            background: rgba(0,0,0,0.75); color: #FFE566; border: none;
            border-radius: 6px; font-weight: 700; font-size: 17px;
            cursor: pointer; transition: background 0.2s;
            position: relative; z-index: 1; letter-spacing: 0.5px;
            display: flex; align-items: center; justify-content: center; gap: 6px;
        }
        .btn-confirmar-nota:hover { background: rgba(0,0,0,0.9); }

        /* ── VOLVER ── */
        .btn-volver {
            display: inline-flex; align-items: center; gap: 8px;
            background: var(--surface); border: 1.5px solid var(--border);
            border-radius: var(--radius-sm); padding: 8px 16px;
            font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 14px;
            color: var(--text-muted); cursor: pointer; margin-bottom: 18px; transition: all 0.2s;
        }
        .btn-volver:hover { background: var(--bg); color: var(--text); transform: translateX(-2px); }

        /* ── ANIMATIONS ── */
        @keyframes slideUp    { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
        @keyframes fadeInUp   { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
        @keyframes slideInRight  { from { opacity: 0; transform: translateX(60px); }  to { opacity: 1; transform: translateX(0); } }
        @keyframes slideOutRight { from { opacity: 1; transform: translateX(0); }      to { opacity: 0; transform: translateX(60px); } }
        @keyframes popIn { from { transform: scale(0) rotate(-2.5deg); opacity: 0; } to { transform: scale(1) rotate(-2.5deg); opacity: 1; } }

        /* ── RESPONSIVE ── */
        @media (max-width: 900px) {
            .grid-locales  { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
            .products-grid { grid-template-columns: 1fr 1fr; }
            .home-hero h2  { font-size: 26px; }
        }
        @media (max-width: 600px) {
            .top-bar     { flex-wrap: wrap; height: auto; padding: 8px 14px; gap: 8px; }
            .logo        { flex-shrink: 0; }
            .nav-actions { margin-left: auto; flex-shrink: 0; }
            .search-wrap { order: 3; flex: 1 1 100%; }
            .container   { padding: 16px 14px; }
            .home-hero   { padding: 28px 22px; min-height: 140px; }
            .home-hero h2 { font-size: 22px; }
            .grid-locales  { grid-template-columns: 1fr; }
            .card-local    { display: flex; flex-direction: row; }
            .card-img-wrap { width: 110px; height: auto; min-height: 110px; flex-shrink: 0; }
            .card-overlay  { display: none; }
            .card-info     { flex: 1; }
            .products-grid { grid-template-columns: 1fr; }
            .ticket-nota   { right: 12px; bottom: 12px; }
        }