/* ═══════════════════════════════════════════════════════════
   YUMMIO v3 — Elegant Cocktail-Bar Style Menu
   Horizontal cards, hero branding, warm rose palette
   Inspired by Marilyn Aperitiv design
   ═══════════════════════════════════════════════════════════ */

/* ── Reset & Variables ── */
:root {
    --primary: #c1272d;
    --primary-light: #e63946;
    --primary-bg: rgba(193,39,45,0.06);
    --accent-gold: #c9a96e;
    --text: #2a2a2a;
    --text-light: #777;
    --text-muted: #aaa;
    --bg: #fdf6f0;
    --bg-warm: #faf0ea;
    --card-bg: #ffffff;
    --border: #f0e6df;
    --shadow-sm: 0 2px 8px rgba(120,60,40,0.06);
    --shadow-md: 0 4px 20px rgba(120,60,40,0.10);
    --shadow-lg: 0 10px 40px rgba(120,60,40,0.14);
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 30px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
body.v3-menu {
    padding-bottom: 76px;
}
body.v3-menu-only {
    padding-bottom: 0;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: var(--primary-light); text-decoration: none; }

/* ═══════════════════════════════════════════════════════════
   HERO SECTION — Restaurant branding
   ═══════════════════════════════════════════════════════════ */

.v3-hero {
    position: relative;
    text-align: center;
    padding: 48px 24px 32px;
    overflow: hidden;
    background: linear-gradient(180deg, var(--bg-warm) 0%, var(--bg) 100%);
}
.v3-hero::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -10%;
    width: 120%;
    height: 140%;
    background: radial-gradient(ellipse at 50% 30%, rgba(193,39,45,0.04) 0%, transparent 60%),
                radial-gradient(ellipse at 80% 60%, rgba(201,169,110,0.06) 0%, transparent 50%);
    pointer-events: none;
}
.v3-hero-logo {
    position: relative;
    z-index: 2;
    height: 40px;
    width: auto;
    max-width: 80%;
    margin-bottom: 16px;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.12));
    object-fit: contain;
}
.v3-hero-name {
    position: relative;
    z-index: 2;
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: 900;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--text);
    margin-bottom: 4px;
    line-height: 1.1;
}
.v3-hero-subtitle {
    position: relative;
    z-index: 2;
    font-family: var(--font-display);
    font-size: 22px;
    font-style: italic;
    color: var(--primary);
    margin-bottom: 6px;
    font-weight: 400;
}
.v3-hero-tagline {
    position: relative;
    z-index: 2;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 6px;
    text-transform: uppercase;
    color: var(--text-muted);
}
.v3-hero-divider {
    position: relative;
    z-index: 2;
    width: 60px;
    height: 3px;
    background: var(--primary);
    margin: 12px auto;
    border-radius: 2px;
}

/* Language switcher in hero */
.v3-lang {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 4px;
    z-index: 10;
}
.v3-lang a {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1.5px solid transparent;
    transition: all var(--transition);
    letter-spacing: 0.5px;
}
.v3-lang a.current {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-bg);
}
.v3-lang a:hover { color: var(--primary); }

/* ═══════════════════════════════════════════════════════════
   STICKY CATEGORY NAV — scrollable pill bar
   ═══════════════════════════════════════════════════════════ */

.v3-cat-nav {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    transition: box-shadow 0.3s ease;
}
.v3-cat-nav.v3-cat-nav--scrolled {
    box-shadow: 0 2px 12px rgba(120,60,40,0.08);
}
.v3-cat-nav-inner {
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    padding: 10px 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.v3-cat-nav-inner::-webkit-scrollbar {
    display: none;
}
.v3-cat-nav-item {
    flex-shrink: 0;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    background: transparent;
    border: 1.5px solid var(--border);
    white-space: nowrap;
    transition: all var(--transition);
    text-decoration: none;
}
.v3-cat-nav-item:hover {
    color: var(--primary);
    border-color: var(--primary);
    text-decoration: none;
}
.v3-cat-nav-item.active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

/* ═══════════════════════════════════════════════════════════
   CATEGORY SECTION HEADER — with icon & decorative line
   ═══════════════════════════════════════════════════════════ */

.v3-category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 28px 0 16px 0;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    scroll-margin-top: 60px;
}
.v3-category-header:first-of-type {
    margin-top: 8px;
}
.v3-cat-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.v3-cat-icon i {
    font-size: 16px;
    color: var(--primary);
}
.v3-cat-name {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}
.v3-cat-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, var(--primary) 0%, transparent 100%);
    border-radius: 1px;
    min-width: 30px;
}
.v3-cat-chevron {
    font-size: 13px;
    color: var(--text-muted);
    margin-left: 4px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

/* Sotto-titolo per le sotto-categorie */
.v3-subcategory-title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-light);
    margin: 14px 0 8px 0;
    padding: 4px 0 4px 14px;
    border-left: 3px solid var(--primary);
    letter-spacing: 0.3px;
    text-transform: uppercase;
    scroll-margin-top: 60px;
}

/* ═══════════════════════════════════════════════════════════
   PRODUCT LIST — Horizontal cards (one per row)
   ═══════════════════════════════════════════════════════════ */

.v3-product-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 12px;
}

/* ═══════════════════════════════════════════════════════════
   PRODUCT CARD — Horizontal: image left, text right
   ═══════════════════════════════════════════════════════════ */

.v3-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: row;
    align-items: stretch;
    overflow: hidden;
    position: relative;
    transition: transform var(--transition), box-shadow var(--transition);
}
.v3-card:active {
    transform: scale(0.98);
}
@media (hover: hover) {
    .v3-card:hover {
        box-shadow: var(--shadow-md);
        transform: translateY(-2px);
    }
}

/* Product image — left side */
.v3-card-img {
    flex: 0 0 auto;
    width: 130px;
    height: 130px;
    margin: 10px;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #f5ebe4 0%, #ede2d8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    /* Forza il clip dei bordi arrotondati */
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
    isolation: isolate;
}
.v3-card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.4s ease;
}
.v3-card:hover .v3-card-img img:not([src*="segnaposto"]) {
    transform: scale(1.06);
}
.v3-card-img picture {
    display: block;
    width: 100%;
    height: 100%;
}
.v3-card-img picture img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.4s ease;
}
/* Placeholder image — centered, subtle */
.v3-card-img > img[src*="segnaposto"],
.v3-card-img > img.v3-placeholder {
    width: 75%;
    height: auto;
    object-fit: contain;
    opacity: 0.2;
    filter: grayscale(100%);
}

/* Points badge — inline next to name */
.v3-badge {
    background: rgba(255,248,225,0.95);
    color: #d4a017;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    flex-shrink: 0;
}
.v3-badge .fas { font-size: 9px; }

/* Card body — center */
.v3-card-body {
    padding: 12px 0 12px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    justify-content: center;
    gap: 3px;
}
.v3-card-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.v3-card-name {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.v3-card-desc {
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-light);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Bottom row: price + allergens */
.v3-card-bottom-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}
.v3-card-price {
    font-size: 15px;
    font-weight: 800;
    color: black;
    white-space: nowrap;
}

/* Allergens inline */
.v3-card-allergens {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    align-items: center;
}
.v3-card-allergens img {
    width: 16px;
    height: 16px;
    opacity: 0.45;
    border-radius: 50%;
}

/* Action column — far right */
.v3-card-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 12px 12px 0;
    flex-shrink: 0;
}
.v3-card-add {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    background: transparent;
    color: var(--primary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
}
.v3-card-add:hover {
    background: var(--primary);
    color: #fff;
}
.v3-card-add:active {
    transform: scale(0.9);
}
.v3-card-qty {
    width: 38px;
    height: 32px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    background: var(--bg);
    -moz-appearance: textfield;
    appearance: textfield;
}
.v3-card-qty::-webkit-inner-spin-button,
.v3-card-qty::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.v3-card-qty:focus {
    outline: none;
    border-color: var(--primary);
}

/* ═══════════════════════════════════════════════════════════
   CONTAINER
   ═══════════════════════════════════════════════════════════ */

.v3-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ═══════════════════════════════════════════════════════════
   CART — Bottom bar (mobile) / Sidebar (desktop)
   ═══════════════════════════════════════════════════════════ */

.v3-cart {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: var(--primary);
    height: 60px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: 0 -4px 30px rgba(193,39,45,0.20);
    padding: 0 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* Top row: titolo + badge — sempre visibile */
.v3-cart-topbar {
    display: flex;
    align-items: center;
    height: 60px;
    cursor: pointer;
}
.v3-cart-arrow {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
    transition: background var(--transition);
}
.v3-cart-arrow i {
    color: #fff;
    font-size: 14px;
    transition: transform 0.3s ease;
}
.v3-cart-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.v3-cart-count {
    min-width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    margin-left: 10px;
    flex-shrink: 0;
    padding: 0 4px;
}

/* Contenuti carrello — nascosti quando chiuso su mobile */
.v3-cart-body {
    display: none;
    padding: 0 0 32px;
}

/* Cart expanded (mobile) */
.v3-cart.aperto {
    height: 80vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 16px;
}
.v3-cart.aperto .v3-cart-body {
    display: block;
}
.v3-cart.aperto .v3-cart-topbar {
    position: sticky;
    top: 0;
    background: var(--primary);
    z-index: 2;
    cursor: pointer;
    margin-bottom: 8px;
}
.v3-cart.aperto .v3-cart-arrow i {
    transform: rotate(180deg);
}

/* Cart items table */
.v3-cart .table {
    color: #fff;
    font-size: 14px;
    width: 100%;
}
.v3-cart .table td {
    border-bottom: 1px solid rgba(255,255,255,0.12);
    border-top: none;
    padding: 10px 4px;
    vertical-align: middle;
}
.v3-cart .fas { color: #fff; cursor: pointer; transition: transform 0.2s; }
.v3-cart .fas:hover { transform: scale(1.2); }
.v3-cart .quantitacarrello { font-weight: 700; margin: 0 4px; }
.v3-cart .totale { font-size: 18px; font-weight: 700; color: #fff; padding: 12px 0; }

/* Cart CTA buttons */
.v3-cart-cta {
    display: block;
    background: #fff;
    color: var(--primary);
    font-size: 15px;
    font-weight: 800;
    text-align: center;
    padding: 14px;
    border-radius: var(--radius-md);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    transition: all var(--transition);
}
.v3-cart-cta:hover {
    background: rgba(255,255,255,0.9);
    color: var(--primary);
    text-decoration: none;
}
.v3-cart-empty {
    display: block;
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    text-align: center;
    transition: color var(--transition);
}
.v3-cart-empty:hover { color: #fff; }

/* Flash animation */
.v3-cart.cart-flash,
.v3-cart.carrello-aggiunta {
    background: linear-gradient(135deg, #2a1a1a 0%, #1a1214 100%) !important;
    transition: background 0.3s ease;
}
@keyframes v3pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.25); }
    100% { transform: scale(1); }
}
.v3-cart-count.pulse { animation: v3pulse 0.3s ease; }

/* Desktop sidebar cart */
@media (min-width: 768px) {
    .v3-cart {
        position: fixed;
        top: 0;
        left: auto;
        right: 0;
        bottom: 0;
        width: 320px;
        height: 100vh;
        border-radius: 0;
        padding: 24px 20px;
        overflow-y: auto;
        box-shadow: -2px 0 20px rgba(0,0,0,0.08);
    }
    .v3-cart .v3-cart-topbar {
        height: auto;
        cursor: default;
        margin-bottom: 16px;
        padding-bottom: 16px;
        border-bottom: 1px solid rgba(255,255,255,0.15);
    }
    .v3-cart .v3-cart-body { display: block; }
    .v3-cart .v3-cart-count { display: none; }
    .v3-cart .v3-cart-arrow { display: none; }
    .v3-cart .v3-cart-title {
        font-size: 16px;
        letter-spacing: 1px;
    }
    body.v3-menu:not(.v3-menu-only) {
        padding-bottom: 0;
        padding-right: 320px;
    }
    body.v3-menu-only .v3-container {
        max-width: 780px;
    }
    .v3-container { max-width: 680px; }
}

/* ═══════════════════════════════════════════════════════════
   ALLERGENS FOOTER
   ═══════════════════════════════════════════════════════════ */

.v3-allergens-section {
    margin-top: 36px;
    padding: 24px 0 48px;
    border-top: 1px solid var(--border);
}
.v3-allergens-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 14px;
}
.v3-allergens-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.v3-allergen-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 6px 14px;
    font-size: 12px;
    color: var(--text-light);
    transition: all var(--transition);
}
.v3-allergen-tag:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.v3-allergen-tag img {
    width: 18px;
    height: 18px;
    border-radius: 50%;
}

/* ═══════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════ */

.d-none { display: none !important; }



/* Responsive adjustments */
@media (max-width: 360px) {
    .v3-card-img {
        width: 90px;
        height: 90px;
        margin: 8px;
        border-radius: 10px;
    }
    .v3-card-img img,
    .v3-card-img picture img { border-radius: 10px; }
    .v3-card-name { font-size: 15px; }
    .v3-card-price { font-size: 14px; }
    .v3-card-add { width: 36px; height: 36px; font-size: 16px; }
    .v3-card-action { padding: 10px 8px 10px 0; }
    .v3-hero-logo { height: 100px; }
    .v3-hero-subtitle { font-size: 18px; }
}

@media (min-width: 600px) {
    .v3-card-img {
        width: 150px;
        height: 150px;
        margin: 12px;
    }
    .v3-card-body { padding: 16px 0 16px 10px; }
    .v3-card-name { font-size: 19px; }
    .v3-card-desc { font-size: 13px; }
    .v3-card-price { font-size: 17px; }
    .v3-card-add { width: 46px; height: 46px; font-size: 20px; }
    .v3-hero-logo { height: 150px; }
    .v3-card-placeholder i { font-size: 34px; }
}

/* ═══════════════════════════════════════════════════════════
   NO-IMAGES MODE — ?noimg=1
   Text-only cards, no product images
   ═══════════════════════════════════════════════════════════ */

.v3-no-images .v3-card-img {
    display: none;
}
.v3-no-images .v3-card-body {
    padding: 14px 0 14px 18px;
}
.v3-no-images .v3-card-name {
    font-size: 16px;
}
.v3-no-images .v3-card-desc {
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.12);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.2);
}
