/* ============================================
   RUSTICONE ALLING - Design System & Styles
   ============================================
   Palette:
   --primary:    #8B4513 (Saddle Brown - legno scuro)
   --secondary:  #A0522D (Sienna - terracotta)
   --accent:     #B22222 (Rosso mattone)
   --cream:      #F5E6CC
   --warm-white: #FFF8F0
   --dark:       #2C1810
   --text:       #3E2723
   --text-light: #795548
   --success:    #4CAF50
   --warning:    #FF9800
   --danger:     #E53935

   Font: "Playfair Display" (titoli), "Inter" (corpo)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@400;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #8B4513;
    --primary-light: #A0522D;
    --accent: #B22222;
    --cream: #F5E6CC;
    --warm-white: #FFF8F0;
    --dark: #2C1810;
    --text: #3E2723;
    --text-light: #795548;
    --success: #4CAF50;
    --warning: #FF9800;
    --danger: #E53935;
    --shadow: 0 2px 12px rgba(44,24,16,0.10);
    --shadow-lg: 0 8px 32px rgba(44,24,16,0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.25s ease;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--warm-white);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--dark);
    line-height: 1.3;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--accent); }

img { max-width: 100%; display: block; }

/* ─── HEADER ────────────────────────────────── */
.header {
    background: linear-gradient(135deg, var(--dark), var(--primary));
    color: var(--cream);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header .logo img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.header .logo-text h1 {
    font-size: 1.3rem;
    color: var(--cream);
    margin: 0;
}

.header .logo-text span {
    font-size: 0.75rem;
    color: #D2B48C;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-nav a {
    color: var(--cream);
    font-size: 0.9rem;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.header-nav a:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.nav-account-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.cart-badge {
    position: relative;
    font-size: 1.3rem;
    cursor: pointer;
}

.cart-badge .count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--accent);
    color: #fff;
    font-size: 0.65rem;
    font-family: 'Inter', sans-serif;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* ─── HERO ──────────────────────────────────── */
.hero {
    background: linear-gradient(rgba(44,24,16,0.55), rgba(139,69,19,0.6)), url('/assets/rusticonealling_cop.jpg') center/cover no-repeat;
    color: var(--cream);
    text-align: center;
    padding: 80px 20px;
    position: relative;
    overflow: hidden;
}

.hero-eyebrow {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #D2B48C;
    margin-bottom: 8px;
    opacity: 0.85;
}

.hero h1 {
    font-size: 2.8rem;
    color: #fff;
    margin-bottom: 8px;
}

.hero p {
    font-size: 1.1rem;
    color: #D2B48C;
    max-width: 500px;
    margin: 0 auto 24px;
}

.hero .btn-hero {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 14px 36px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.hero .btn-hero:hover {
    background: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(178,34,34,0.4);
}

/* ─── CONTAINER ─────────────────────────────── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ─── CATEGORIES NAV ────────────────────────── */
.categories-nav-wrapper {
    position: sticky;
    top: 72px;
    z-index: 50;
    background: var(--warm-white);
    border-bottom: 1px solid var(--cream);
    box-shadow: 0 2px 8px rgba(44,24,16,0.07);
}

.categories-nav {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0 10px 20px;
    max-width: 1200px;
    margin: 0 auto;
    scrollbar-width: none;
}

/* Spacer so the last button never gets clipped by the container edge */
.categories-nav::after {
    content: '';
    flex: 0 0 20px;
    min-width: 20px;
}

.categories-nav::-webkit-scrollbar { display: none; }

.cat-btn {
    flex-shrink: 0;
    padding: 10px 20px;
    border: 2px solid var(--cream);
    background: #fff;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cat-icon-img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
}

.cat-btn svg {
    vertical-align: middle;
    flex-shrink: 0;
}

.menu-section h2 .cat-icon-img {
    width: 30px;
    height: 30px;
}

.cat-btn:hover, .cat-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ─── MENU SECTION ──────────────────────────── */
.menu-section {
    margin-bottom: 40px;
}

.menu-section h2 {
    font-size: 1.6rem;
    margin-bottom: 6px;
    padding-bottom: 8px;
    border-bottom: 3px solid var(--cream);
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-section .section-desc {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.dishes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

/* ─── DISH CARD ─────────────────────────────── */
.dish-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.dish-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.dish-card .dish-img {
    height: 170px;
    background: linear-gradient(135deg, var(--cream), #E8D5B7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    overflow: hidden;
    flex-shrink: 0;
}

.dish-card .dish-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.dish-card:hover .dish-img img {
    transform: scale(1.04);
}

.dish-card .dish-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.dish-card .dish-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.dish-card .dish-desc {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 8px;
    flex: 1;
}

.dish-card .dish-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.dish-card .dish-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
}

.dish-card .dish-time {
    font-size: 0.8rem;
    color: var(--text-light);
}

.dish-card .allergens-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.allergen-tag {
    font-size: 0.65rem;
    background: var(--cream);
    color: var(--text-light);
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-add {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-add:hover {
    background: var(--accent);
    transform: scale(1.05);
}

.dish-unavailable {
    opacity: 0.5;
    pointer-events: none;
}

.dish-unavailable::after {
    content: 'Non disponibile';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

/* ─── CART ──────────────────────────────────── */
.cart-panel {
    position: fixed;
    right: -420px;
    top: 0;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    height: 100dvh;
    background: #fff;
    box-shadow: -4px 0 30px rgba(0,0,0,0.2);
    z-index: 200;
    transition: right 0.35s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cart-panel.open { right: 0; }

.cart-header {
    padding: 20px;
    background: var(--dark);
    color: var(--cream);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-header h2 { color: var(--cream); font-size: 1.2rem; }

.cart-close {
    background: none;
    border: none;
    color: var(--cream);
    font-size: 1.5rem;
    cursor: pointer;
}

.cart-items {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid var(--cream);
    gap: 12px;
}

.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 600; font-size: 0.95rem; }
.cart-item-extras { font-size: 0.8rem; color: var(--text-light); }
.cart-item-notes { font-size: 0.8rem; color: var(--text-light); font-style: italic; }

.cart-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.cart-item-price { font-weight: 700; color: var(--accent); }

.qty-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--cream);
    background: var(--warm-white);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.qty-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.cart-item-remove {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 0.8rem;
}

.cart-footer {
    padding: 20px;
    border-top: 2px solid var(--cream);
    background: var(--warm-white);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.cart-empty-icon { font-size: 3rem; margin-bottom: 12px; }

/* ─── CHECKOUT ──────────────────────────────── */
.checkout-page {
    max-width: 700px;
    margin: 30px auto;
    padding: 0 20px;
}

.checkout-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 20px;
}

.checkout-card h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--cream);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--cream);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139,69,19,0.1);
}

.form-group textarea { resize: vertical; min-height: 80px; }

.order-type-select {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.order-type-option {
    padding: 16px;
    border: 2px solid var(--cream);
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.order-type-option:hover { border-color: var(--primary-light); }

.order-type-option.selected {
    border-color: var(--primary);
    background: rgba(139,69,19,0.05);
}

.order-type-option .icon { font-size: 2rem; margin-bottom: 6px; }
.order-type-option .label { font-weight: 600; }

.payment-options { display: flex; gap: 12px; flex-wrap: wrap; }

.payment-option {
    flex: 1;
    min-width: 120px;
    padding: 14px;
    border: 2px solid var(--cream);
    border-radius: var(--radius-sm);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.payment-option:hover { border-color: var(--primary-light); }
.payment-option.selected {
    border-color: var(--primary);
    background: rgba(139,69,19,0.05);
}
.payment-option .icon { font-size: 1.5rem; }

/* ─── ORDER SUMMARY ─────────────────────────── */
.order-summary-line {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.95rem;
}

.order-summary-line.total {
    font-size: 1.2rem;
    font-weight: 700;
    border-top: 2px solid var(--cream);
    padding-top: 12px;
    margin-top: 8px;
    color: var(--accent);
}

/* ─── TRACKING ──────────────────────────────── */
.tracking-page {
    max-width: 600px;
    margin: 40px auto;
    padding: 0 20px;
    text-align: center;
}

.tracking-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px 30px;
}

.tracking-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.tracking-steps {
    display: flex;
    justify-content: center;
    gap: 0;
    margin: 30px 0;
    position: relative;
}

.tracking-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    z-index: 1;
}

.tracking-step .step-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--cream);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 8px;
    border: 3px solid var(--cream);
    transition: var(--transition);
}

.tracking-step.active .step-icon {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 6px rgba(139,69,19,0.15);
}

.tracking-step.done .step-icon {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.tracking-step .step-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-align: center;
}

.tracking-step.active .step-label,
.tracking-step.done .step-label {
    color: var(--text);
    font-weight: 600;
}

.tracking-line {
    position: absolute;
    top: 24px;
    left: 15%;
    right: 15%;
    height: 3px;
    background: var(--cream);
    z-index: 0;
}

.tracking-line-fill {
    height: 100%;
    background: var(--success);
    transition: width 0.5s ease;
}

/* ─── BUTTONS ───────────────────────────────── */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--accent); transform: translateY(-1px); }

.btn-secondary { background: var(--cream); color: var(--text); }
.btn-secondary:hover { background: #E8D5B7; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #C62828; }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #388E3C; }

.btn-block { display: block; width: 100%; }

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ─── OVERLAY ───────────────────────────────── */
.overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.overlay.active { opacity: 1; visibility: visible; }

/* ─── TOAST NOTIFICATIONS ───────────────────── */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: #fff;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
    min-width: 280px;
    border-left: 4px solid var(--primary);
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ─── FOOTER ────────────────────────────────── */
.footer {
    background: var(--dark);
    color: #D2B48C;
    text-align: center;
    padding: 30px 20px;
    margin-top: 60px;
    font-size: 0.85rem;
}

.footer a { color: var(--cream); }
.footer .footer-brand { font-family: 'Playfair Display', serif; font-size: 1.2rem; color: #fff; margin-bottom: 8px; }

/* ─── LANGUAGE SWITCH ───────────────────────── */
.lang-switch {
    display: inline-flex;
    gap: 0;
    margin-top: 14px;
    border-radius: 24px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.2);
}
.lang-option {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    padding: 8px 20px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}
.lang-option:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}
.lang-option.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.4);
}

/* ─── STATUS BADGE ──────────────────────────── */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-ricevuto { background: #E3F2FD; color: #1565C0; }
.status-in_preparazione { background: #FFF3E0; color: #E65100; }
.status-pronto { background: #E8F5E9; color: #2E7D32; }
.status-in_consegna { background: #F3E5F5; color: #7B1FA2; }
.status-consegnato, .status-ritirato { background: #E0F2F1; color: #00695C; }
.status-annullato { background: #FFEBEE; color: #C62828; }

/* ─── RESPONSIVE ────────────────────────────── */

/* Mobile header actions (cart + hamburger) - hidden on desktop */
.mobile-header-actions { display: none; }

/* Hamburger button */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.hamburger:hover { background: rgba(255,255,255,0.1); }
.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--cream);
    border-radius: 2px;
    transition: all 0.3s ease;
}
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav overlay */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.mobile-nav-overlay.active { display: block; opacity: 1; }

/* Mobile nav slide panel */
.mobile-nav {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100%;
    background: #2C1810;
    z-index: 999;
    transition: right 0.3s ease;
    overflow-y: auto;
    box-shadow: -4px 0 20px rgba(0,0,0,0.3);
}
.mobile-nav.active { right: 0; }

.mobile-nav-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: var(--cream);
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--font-heading);
}

.mobile-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    color: var(--cream);
    font-size: 1rem;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    transition: var(--transition);
}
.mobile-nav a:hover,
.mobile-nav a:active {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

/* Mobile cart badge in header */
.mobile-cart {
    color: var(--cream);
}
.mobile-cart svg {
    stroke: var(--cream);
}

/* Tablet */
@media (max-width: 1024px) {
    .dishes-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
    .hero h1 { font-size: 2.2rem; }
}

/* Mobile */
@media (max-width: 768px) {
    /* Header - hide desktop nav, show hamburger */
    .header-nav { display: none; }
    .mobile-header-actions {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .header-inner { padding: 10px 14px; gap: 8px; }
    .header .logo img { width: 36px; height: 36px; }
    .header .logo-text h1 { font-size: 1rem; }
    .header .logo-text span { font-size: 0.65rem; letter-spacing: 1px; }
    .header .logo { gap: 8px; }

    /* Hero */
    .hero { padding: 36px 16px; }
    .hero h1 { font-size: 1.7rem; }
    .hero p { font-size: 0.9rem; margin-bottom: 18px; }
    .hero .btn-hero { padding: 12px 28px; font-size: 0.9rem; }

    /* Container */
    .container { padding: 14px; }

    /* Categories nav */
    .categories-nav-wrapper { top: 56px; }
    .categories-nav { padding: 8px 14px; gap: 8px; }
    .cat-btn { padding: 8px 14px; font-size: 0.8rem; }

    /* Dishes grid */
    .dishes-grid { grid-template-columns: 1fr; gap: 12px; }
    .dish-card .dish-img { height: 120px; font-size: 2.5rem; }
    .dish-card .dish-body { padding: 12px; }
    .dish-card .dish-name { font-size: 1rem; }
    .dish-card .dish-desc { font-size: 0.8rem; }
    .dish-card .dish-price { font-size: 1.1rem; }
    .menu-section h2 { font-size: 1.3rem; }

    /* Buttons touch-friendly */
    .btn { padding: 12px 24px; min-height: 44px; }
    .btn-add { padding: 10px 14px; min-height: 44px; }

    /* Cart panel full-width */
    .cart-panel { width: 100%; right: -100%; }
    .cart-header { padding: 16px; }
    .cart-header h2 { font-size: 1.1rem; }
    .cart-items { padding: 12px; }
    .cart-footer { padding: 14px; }
    .cart-total { font-size: 1.1rem; }

    /* Checkout */
    .checkout-page { margin: 16px auto; padding: 0 12px; }
    .checkout-page > h1 { font-size: 1.3rem; margin-bottom: 16px; }
    .checkout-card { padding: 18px; margin-bottom: 14px; }
    .checkout-card h2 { font-size: 1.1rem; margin-bottom: 14px; padding-bottom: 8px; }
    .order-type-select { grid-template-columns: 1fr; gap: 10px; }
    .order-type-option { padding: 14px; }
    .order-type-option .icon { font-size: 1.6rem; }
    .payment-options { gap: 8px; }
    .payment-option { min-width: 90px; padding: 10px; }

    /* Forms touch-friendly */
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px;
        font-size: 1rem;
        min-height: 44px;
    }

    /* Tracking */
    .tracking-page { margin: 20px auto; padding: 0 12px; }
    .tracking-card { padding: 24px 16px; }
    .tracking-number { font-size: 1.2rem; }
    .tracking-steps { flex-direction: column; align-items: center; gap: 0; margin: 20px 0; }
    .tracking-step { flex-direction: row; gap: 12px; width: 100%; justify-content: flex-start; padding: 10px 0; }
    .tracking-step .step-icon { width: 40px; height: 40px; font-size: 1.1rem; margin-bottom: 0; flex-shrink: 0; }
    .tracking-step .step-label { font-size: 0.8rem; text-align: left; }
    .tracking-line { display: none; }

    /* Modal */
    .modal { width: 96%; max-width: none; max-height: 90vh; border-radius: var(--radius-sm); }
    .modal-header { padding: 16px; }
    .modal-body { padding: 16px; }
    .modal-footer { padding: 12px 16px; flex-wrap: wrap; }
    .modal-footer .btn { flex: 1; text-align: center; min-width: 0; }

    /* Toast */
    .toast-container { top: 60px; right: 10px; left: 10px; }
    .toast { min-width: 0; width: 100%; font-size: 0.85rem; padding: 12px 14px; }

    /* Footer */
    .footer { margin-top: 30px; padding: 24px 16px; }
    .footer .footer-brand { font-size: 1rem; }
}

/* Very small screens */
@media (max-width: 380px) {
    .header .logo-text span { display: none; }
    .hero h1 { font-size: 1.4rem; }
    .hero p { font-size: 0.85rem; }
    .checkout-card { padding: 14px; }
    .checkout-card h2 { font-size: 1rem; }
    .cat-btn { padding: 7px 10px; font-size: 0.75rem; }
    .tracking-card { padding: 18px 12px; }
    .modal-footer { flex-direction: column; }
    .modal-footer .btn { width: 100%; }
}

/* ─── MODAL ─────────────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 250;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
    background: #fff;
    border-radius: var(--radius);
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: var(--transition);
}

.modal-overlay.active .modal { transform: translateY(0); }

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--cream);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 { font-size: 1.2rem; }

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--cream);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ─── EXTRAS LIST ───────────────────────────── */
.extras-section {
    margin-bottom: 16px;
}
.extras-title {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}
.extras-scroll {
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid var(--cream);
    border-radius: var(--radius-sm);
    padding: 4px 0;
    scrollbar-width: thin;
}
.extras-scroll::-webkit-scrollbar { width: 6px; }
.extras-scroll::-webkit-scrollbar-track { background: var(--cream); border-radius: 3px; }
.extras-scroll::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 3px; }

.extras-group-title {
    position: sticky;
    top: 0;
    background: var(--cream);
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    -webkit-user-select: none;
    user-select: none;
    z-index: 1;
}
.extras-toggle {
    font-size: 0.7rem;
    transition: transform 0.2s;
}
.extras-group.collapsed .extras-toggle { transform: rotate(-90deg); }
.extras-group.collapsed .extras-group-items { display: none; }

.extra-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}
.extra-item:last-child { border-bottom: none; }
.extra-item:hover { background: rgba(139,69,19,0.04); }

.extra-item input[type="checkbox"] {
    display: none;
}
.extra-check {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid #ccc;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.extra-item input:checked ~ .extra-check {
    background: var(--primary);
    border-color: var(--primary);
}
.extra-item input:checked ~ .extra-check::after {
    content: '✓';
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
}
.extra-name {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text);
}
.extra-price {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
}

/* ─── LOADING SPINNER ───────────────────────── */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--cream);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 20px auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

.page-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: var(--text-light);
}

/* ─── CHECKOUT PRIZE BANNER ─────────────────── */

.checkout-prize-banner {
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    border: 2px solid #81c784;
    border-radius: var(--radius);
    padding: 0;
    overflow: hidden;
}
.prize-banner-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
}
.prize-banner-icon {
    font-size: 2.2rem;
    flex-shrink: 0;
    line-height: 1;
}
.prize-banner-body { flex: 1; }
.prize-banner-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1b5e20;
    margin-bottom: 4px;
}
.prize-banner-note {
    font-size: 0.82rem;
    color: #388e3c;
    font-style: italic;
}

/* Badge GRATIS negli item del checkout */
.prize-gratis-badge {
    display: inline-block;
    margin-left: 8px;
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #81c784;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 1px 8px;
    vertical-align: middle;
    letter-spacing: 0.3px;
}

/* Riga sconto nel riepilogo totali */
.prize-discount-line {
    color: #2e7d32;
    font-weight: 600;
}

/* ─── PRENOTAZIONI ──────────────────────────── */

/* Utility: nasconde un elemento senza inline style */
.res-hidden { display: none !important; }

/* Pulsante "Prenota un Tavolo" nell'header desktop */
.btn-reserve {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 8px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-reserve:hover {
    background: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(178,34,34,0.4);
}

/* Link "Prenota" nel pannello di navigazione mobile */
.mobile-nav .reserve-nav-link {
    border-top: 2px solid rgba(178, 34, 34, 0.3);
    margin-top: 4px;
    font-weight: 600;
    color: #F5A0A0 !important;
}
.mobile-nav .reserve-nav-link:hover,
.mobile-nav .reserve-nav-link:active {
    color: #fff !important;
    background: rgba(178, 34, 34, 0.2);
}

/* Header della modal prenotazione con gradiente brand */
.reservation-modal-header {
    background: linear-gradient(135deg, var(--dark), var(--primary));
    border-radius: var(--radius) var(--radius) 0 0;
}
.reservation-modal-header h3 {
    color: var(--cream);
    font-size: 1.2rem;
}
.reservation-modal-header .modal-close {
    color: var(--cream);
    opacity: 0.8;
}
.reservation-modal-header .modal-close:hover { opacity: 1; }

/* Layout 2 colonne per Data + Orario */
.res-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.res-form-row .form-group { margin-bottom: 0; }

/* Contenitore stato di successo */
.reservation-success {
    text-align: center;
    padding: 40px 28px;
}

/* Icona animata al successo */
.reservation-success-icon {
    width: 80px;
    height: 80px;
    background: #E8F5E9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2.5rem;
    will-change: transform, opacity;
    animation: resPopIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes resPopIn {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.reservation-success h3 {
    font-size: 1.4rem;
    color: var(--success);
    margin-bottom: 10px;
}
.reservation-success p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Riepilogo dati prenotazione nel pannello successo */
.res-success-detail {
    background: var(--warm-white);
    border: 1px solid var(--cream);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin-bottom: 24px;
    font-size: 0.95rem;
    line-height: 2.2;
    color: var(--text);
    text-align: left;
}

/* Responsive: su mobile il layout 2-col diventa 1-col */
@media (max-width: 768px) {
    .res-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .res-form-row .form-group { margin-bottom: 16px; }
    .reservation-success { padding: 28px 16px; }
    .reservation-success-icon { width: 64px; height: 64px; font-size: 2rem; }
    .reservation-success h3 { font-size: 1.2rem; }
}

/* Chip di stato prenotazione accanto al pulsante "Prenota" */
#resStatusChip.res-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    vertical-align: middle;
    animation: resPopIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    will-change: transform, opacity;
}
.chip-waiting  { background: #fff3cd; color: #92600a; border: 1px solid #f0c05a; }
.chip-confirmed { background: #d4edda; color: #155724; border: 1px solid #8ecf9a; }
.chip-rejected  { background: #f8d7da; color: #721c24; border: 1px solid #f1aeb5; }

/* Messaggio di stato all'interno del pannello successo */
.res-status-msg {
    margin: 0 auto 20px;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 600;
    text-align: center;
    max-width: 340px;
}
.status-msg-waiting  { background: #fff8e1; color: #7a5000; border: 1px solid #f0c05a; }
.status-msg-confirmed { background: #e8f5e9; color: #1b5e20; border: 1px solid #81c784; }
.status-msg-rejected  { background: #fce4ec; color: #880e4f; border: 1px solid #f48fb1; }

/* ─── SUNMI V2 (1440×720) ──────────────────── */
@media (max-height: 720px) and (min-width: 1024px) {
    /* Header compact */
    .header-inner { padding: 6px 20px; }
    .header .logo img { width: 36px; height: 36px; }
    .header .logo-text h1 { font-size: 1.1rem; }
    .header .logo-text span { font-size: 0.65rem; }
    .header-nav a { padding: 6px 10px; font-size: 0.85rem; }

    /* Hero compact */
    .hero { padding: 32px 20px; }
    .hero h1 { font-size: 2rem; margin-bottom: 4px; }
    .hero p { font-size: 0.95rem; margin-bottom: 14px; }
    .hero .btn-hero { padding: 10px 28px; font-size: 0.9rem; }

    /* Container compact */
    .container { padding: 12px 20px; }

    /* Categories nav */
    .categories-nav-wrapper { top: 52px; }
    .categories-nav { padding: 6px 20px; }
    .cat-btn { padding: 6px 14px; font-size: 0.8rem; }

    /* Dishes grid — 3 col compact */
    .dishes-grid { gap: 10px; }
    .dish-card .dish-img { height: 110px; }
    .dish-card .dish-body { padding: 10px; }
    .dish-card .dish-name { font-size: 0.95rem; }
    .dish-card .dish-desc { font-size: 0.8rem; -webkit-line-clamp: 2; }
    .dish-card .dish-price { font-size: 1rem; }
    .dish-card .dish-meta { margin: 4px 0; }
    .menu-section { margin-bottom: 20px; }
    .menu-section h2 { font-size: 1.3rem; margin-bottom: 8px; }

    /* Cart panel compact */
    .cart-header { padding: 10px 16px; }
    .cart-items { padding: 8px 14px; }
    .cart-footer { padding: 10px 16px; }
    .cart-total { font-size: 1rem; }

    /* Checkout compact */
    .checkout-page > h1 { font-size: 1.3rem; margin-bottom: 12px; }
    .checkout-card { padding: 16px; margin-bottom: 12px; }
    .checkout-card h2 { font-size: 1rem; margin-bottom: 10px; padding-bottom: 6px; }
    .form-group { margin-bottom: 10px; }
    .form-group input,
    .form-group select,
    .form-group textarea { padding: 8px 12px; font-size: 0.9rem; }
    .form-group label { font-size: 0.8rem; margin-bottom: 4px; }
    .order-type-option { padding: 12px; }
    .payment-option { padding: 10px; }

    /* Tracking compact */
    .tracking-card { padding: 16px; }
    .tracking-number { font-size: 1.1rem; }
    .tracking-steps { margin: 12px 0; }
    .tracking-step .step-icon { width: 36px; height: 36px; font-size: 0.95rem; }
    .tracking-step .step-label { font-size: 0.75rem; }

    /* Modal compact */
    .modal { max-height: 80vh; }
    .modal-header { padding: 12px 20px; }
    .modal-header h3 { font-size: 1.05rem; }
    .modal-body { padding: 14px 20px; }
    .modal-footer { padding: 10px 20px; }

    /* Footer compact */
    .footer { margin-top: 16px; padding: 16px; }
    .footer .footer-brand { font-size: 0.95rem; }

    /* Toast */
    .toast-container { top: 54px; }

    /* Page loading */
    .page-loading { min-height: 200px; }
}

/* ── Address Autocomplete ─────────────────────────── */
.address-autocomplete-wrap {
    position: relative;
}
.address-autocomplete-wrap input {
    width: 100%;
    box-sizing: border-box;
}
.address-suggestions {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    list-style: none;
    margin: 0;
    padding: 6px 0;
    z-index: 999;
    max-height: 260px;
    overflow-y: auto;
}
.address-suggestions.open {
    display: block;
}
.address-suggestions li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 14px;
    cursor: pointer;
    transition: background .15s;
    border-bottom: 1px solid #f5f5f5;
    font-size: 0.9rem;
}
.address-suggestions li:last-child {
    border-bottom: none;
}
.address-suggestions li:hover,
.address-suggestions li.active {
    background: #fff5f5;
}
.address-suggestions li .sug-icon {
    flex-shrink: 0;
    color: #C0392B;
    margin-top: 2px;
}
.address-suggestions li .sug-main {
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
}
.address-suggestions li .sug-sub {
    font-size: 0.78rem;
    color: #999;
    margin-top: 2px;
    line-height: 1.3;
}
.address-suggestions .sug-loading,
.address-suggestions .sug-empty {
    padding: 14px;
    color: #aaa;
    font-size: 0.85rem;
    text-align: center;
    cursor: default;
}
