﻿/* ═══════════════════════════════════════════════════════════════
   layout.css  —  Jefferson Pizzeria
   Stili globali del layout: header, nav, main-wrap, footer.
   Incluso nell'<head> di _Layout.cshtml, disponibile su tutte le pagine.
   NON usare CSS Isolation per questo file: le classi jp-* sono
   condivise tra il layout e le pagine figlie.
═══════════════════════════════════════════════════════════════ */

/* ── VARIABILI ────────────────────────────────────────────────── */
:root {
    --jp-max-w: 1200px; /* larghezza max desktop — sostituisce 150vh (non standard) */
    --jp-red: #c0392b;
    --jp-red-dark: #a93226;
    --jp-red-bg: #fdf8f8;
    --jp-red-border: #f0d0ce;
    --jp-orange: #f39c12;
    --jp-green: #b8dfc8cc;
    --jp-blue: #2c3e7a;
    --jp-blue-dark: #1a2460;
    --jp-blue-bg: #f8f8fd;
    --jp-blue-border: #c5cae9;
    --jp-amber: #b5860d;
    --jp-amber-bg: #fdfaf4;
    --jp-amber-border: #eddfc0;
    --jp-forest: #2e7d4f;
    --jp-forest-bg: #f7fdf9;
    --jp-forest-border: #b8dfc8;
    --jp-gray: #666;
    --jp-white: #fff;
    /* Header soft (tinta media) */
    --jp-red-header: #e8938b;
    --jp-blue-header: #8d9fd4;
    --jp-amber-header: #d4a843;
    --jp-forest-header: #6db890;
    /* Body soft (tinta chiara) */
    --jp-red-soft: #fdf0ef;
    --jp-blue-soft: #f0f2fa;
    --jp-amber-soft: #fdf6e3;
    --jp-forest-soft: #edf7f2;
}

/* ── RESET BASE ───────────────────────────────────────────────── */
html, body {
    height: 100%;
    margin: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #f0f0f0;
}

/* ═══════════════════════════════════════════════════════════════
   STRUTTURA
═══════════════════════════════════════════════════════════════ */
.jp-header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d0a0a 55%, var(--jp-red) 100%);
    width: var(--jp-max-w);
    max-width: 100%;
    margin: 12px auto 0;
    border-radius: 10px 10px 0 0;
    overflow: visible;
    box-shadow: 0 4px 24px rgba(0,0,0,0.25);
}

    .jp-header::after {
        content: "🍕";
        position: absolute;
        right: 3%;
        top: 50%;
        transform: translateY(-50%);
        font-size: 90px;
        opacity: 0.05;
        pointer-events: none;
    }

.jp-header-wrap {
    padding: 16px 24px 0;
    position: relative;
    z-index: 1;
}

.jp-main-wrap {
    margin: 10px auto 0;
    flex: 1;
    width: var(--jp-max-w);
    max-width: 100%;
    background-color: #fff; /* era lightgrey — sostituito con bianco neutro */
    padding: 10px 15px;
    box-shadow: 10px 8px 24px rgba(0,0,0,0.08);
    overflow-y: visible;
}

.jp-footer {
    border-top: 1px solid #eee;
    margin-top: 40px;
    padding: 15px 0;
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    background-color: #fafafa;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.footer-separator {
    color: #aaa;
}

.jp-footer a {
    color: #c0392b;
    text-decoration: none;
}

    .jp-footer a:hover {
        text-decoration: underline;
    }

/* Responsive */
@media (max-width: 576px) {
    .footer-content {
        flex-direction: row;
        gap: 5px;
    }

    .footer-separator {
        display: none;
    }
}

/* ═══════════════════════════════════════════════════════════════
   HERO
═══════════════════════════════════════════════════════════════ */
.jp-hero-body {
    display: flex;
    align-items: center;
    gap: 10px;
}

.jp-hero-title {
    flex: 1; /* prende tutto lo spazio disponibile */
    min-width: 0; /* IMPORTANTISSIMO per ellipsis */
    white-space: nowrap; /* NON VA A CAPO */
    overflow: hidden;
    text-overflow: ellipsis; /* taglia con ... se serve */
    font-size: clamp(1.1rem, 2.2vw, 1.55rem);
    font-weight: 800;
    color: #fff;
}

    .jp-hero-title em {
        font-style: normal;
        color: var(--jp-orange);
    }

.menu-cat-header span {
    font-size: 18px;
    vertical-align: middle;
}

.free-badge-float {
    position: absolute; /* oppure absolute se dentro un contenitore */
    bottom: 20px; /* posizione */
    right: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: #ff5722; /* colore gettone */
    color: #fff;
    padding: 10px 14px;
    border-radius: 999px; /* effetto pill/gettone */

    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 9999; /* 👈 sopra tutto */

    cursor: pointer;
    transition: transform 0.2s ease;
}

.free-badge-float {
    flex-shrink: 0; /* NON si riduce mai */
    white-space: nowrap; /* resta su una riga */
    display: flex;
    align-items: center;
    gap: 5px;
}

    .free-badge-float i {
        color: var(--jp-green);
        line-height: 1;
    }

    .free-badge-float span {
        font-size: 0.82rem;
        font-weight: 800;
        color: var(--jp-green);
        letter-spacing: 1.2px;
        text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    }

/* ═══════════════════════════════════════════════════════════════
   NAVIGAZIONE
═══════════════════════════════════════════════════════════════ */
.jp-nav-bar {
    display: flex;
    align-items: stretch;
    border-top: 1px solid rgba(255,255,255,0.12);
    min-height: 42px;
}

.jp-nav-links {
    display: flex;
    align-items: stretch;
    flex: 1;
    padding: 5px;
}

.jp-nav-auth {
    display: flex;
    align-items: center;
    padding: 0 14px;
    border-left: 1px solid rgba(255,255,255,0.1);
    gap: 8px;
    white-space: nowrap;
}

/* Brand */
.jp-brand-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 18px;
    text-decoration: none;
    background: rgba(192,57,43,0.35);
    border-right: 1px solid rgba(255,255,255,0.1);
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: inset 0 -2px 8px rgba(0,0,0,0.2);
}

    .jp-brand-btn:hover {
        background: rgba(192,57,43,0.55);
        text-decoration: none;
        box-shadow: inset 0 -2px 8px rgba(0,0,0,0.3), 0 2px 10px rgba(192,57,43,0.4);
    }

.jp-brand-btn__icon {
    font-size: 1.2rem;
    line-height: 1;
}

.jp-brand-btn__text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.jp-brand-btn__name {
    font-size: 0.85rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.jp-brand-btn__sub {
    font-size: 0.56rem;
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.5px;
}

/* Nav link */
.jp-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    width: 7rem;
    color: rgba(255,255,255,0.6) !important;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: color 0.15s, border-color 0.15s, background 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}

    .jp-nav-link:hover {
        color: #fff !important;
        background: rgba(255,255,255,0.07);
        border-bottom-color: rgba(255,255,255,0.25);
        text-decoration: none;
    }

    .jp-nav-link.active {
        color: var(--jp-orange) !important;
        border-bottom-color: var(--jp-orange);
        box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    }

/* Admin */
.jp-nav-admin {
    color: var(--jp-orange) !important;
    margin-left: auto;
}

    .jp-nav-admin:hover {
        color: #fff !important;
        border-bottom-color: var(--jp-orange);
    }

    .jp-nav-admin.active {
        border-bottom-color: var(--jp-orange);
    }

/* Auth */
.jp-nav-auth .nav-link,
.jp-nav-auth a:not(.btn) {
    color: rgba(255,255,255,0.6) !important;
    font-size: 0.74rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s;
}

    .jp-nav-auth .nav-link:hover,
    .jp-nav-auth a:not(.btn):hover {
        color: #fff !important;
    }

.jp-nav-auth .btn-link {
    color: rgba(255,255,255,0.6) !important;
    font-size: 0.74rem;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: color 0.15s;
}

    .jp-nav-auth .btn-link:hover {
        color: #fff !important;
    }

.jp-nav-auth form {
    margin: 0;
}

.jp-nav-auth .navbar-text {
    color: rgba(255,255,255,0.35);
    font-size: 0.74rem;
}

/* Mobile toggler */
.jp-nav-toggle {
    display: none;
}

/* ─── DESKTOP: imposta --jp-header-h per calc() in Index.cshtml.css ─── */
@media (min-width: 721px) {
    :root {
        /* Header desktop: hero-body (~44px) + nav-bar (~42px) + margin-top (12px) = ~98px */
        --jp-header-h: 98px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════ */
@media (max-width: 720px) {
    :root {
        --jp-max-w: 100%;
        /* Riga 1 (hero: titolo + badge + toggle) ~50px
           Riga 2 (nav-bar con brand Home) ~46px
           Totale ~96px + margine sicurezza */
        --jp-header-h: 100px;
    }

    .idx-panel {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
    }

    /* Header fisso, full-width, niente margini — layout via grid sotto */
    .jp-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        margin: 0;
        border-radius: 0;
        width: 100%;
        max-width: 100%;
    }

    .jp-footer {
        margin: 0;
        border-radius: 0;
    }

    .jp-main-wrap {
        margin: var(--jp-header-h) auto 0;
        padding: 1px;
        background: var(--jp-green);
    }

    .jp-header::after {
        display: none;
    }

    /*
     * FIX (A) — jp-header diventa CSS Grid con named areas.
     * DOM reale su mobile (figli diretti di jp-header):
     *   1. jp-hero-body   → area "title"  (contiene solo jp-hero-title)
     *   2. delivery-badge → area "badge"  (assente se ShowDeliveryBadge=false → cella vuota, ok)
     *   3. navToggle      → area "toggle"
     *   4. jp-nav-bar     → area "nav"    (contiene jp-brand-btn Home)
     *
     * Risultato: riga 1 = [titolo | badge | toggle] sulla stessa altezza
     *            riga 2 = [nav-bar full width con Home]
     */
    .jp-header {
        display: grid;
        /* Colonne: [titolo flex] [badge auto] [toggle auto] */
        grid-template-columns: 1fr auto auto;
        /* Righe: [riga1 con titolo/badge/toggle] [riga2 con navBar] */
        grid-template-rows: auto auto;
        grid-template-areas:
            "title badge toggle"
            "nav   nav   nav";
    }

    /* Riga 1 col 1: titolo */
    .jp-hero-body {
        grid-area: title;
        display: flex;
        align-items: center;
        padding: 8px 10px;
        min-height: 46px;
    }

    .jp-hero-title {
        flex: 1;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Riga 1 col 2: delivery badge — stessa altezza del titolo */
    .delivery-badge {
        grid-area: badge;
        position: static !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        align-self: center;
        display: flex;
        flex-direction: column;
        gap: 2px;
        background: rgba(34,34,34,0.85);
        color: #fff;
        padding: 5px 10px;
        font-size: 11px;
        font-weight: 500;
        border-radius: 7px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
        margin: 6px 6px 6px 0;
        z-index: auto;
        white-space: nowrap;
    }

    /* Riga 1 col 3: navToggle — stesso asse verticale */
    .jp-nav-toggle {
        grid-area: toggle;
        display: flex;
        align-items: center;
        justify-content: center;
        align-self: center;
        position: relative;
        z-index: 1100;
        background: transparent;
        border: 1px solid rgba(255,255,255,0.3);
        border-radius: 4px;
        padding: 4px 7px;
        color: #fff;
        font-size: 1.8rem;
        cursor: pointer;
        margin: 6px 8px 6px 0;
    }

    /* Riga 2: jp-nav-bar full width */
    .jp-nav-bar {
        grid-area: nav;
        display: block;
        width: 100%;
        z-index: 1000;
        border-top: 1px solid rgba(255,255,255,0.12);
    }

    .jp-nav-wrapper {
        position: relative;
    }

    .jp-nav-links,
    .jp-nav-auth {
        position: fixed;
        width: 100%;
        background: linear-gradient(135deg, #1a1a1a 0%, #2d0a0a 55%, var(--jp-red) 100%);
        transform: translateY(-120%);
        transition: transform 0.3s ease;
        z-index: 999;
        display: none;
        flex-direction: column;
        padding: 5px;
        align-items: flex-end;
    }

        .jp-nav-links.is-open,
        .jp-nav-auth.is-open {
            transform: translateY(0);
            display: flex;
        }

    .jp-nav-link {
        padding: 10px 0;
        color: white;
        text-decoration: none;
    }

        .jp-nav-link.active {
            border-left-color: var(--jp-orange);
            border-bottom: none;
            box-shadow: inset 3px 0 8px rgba(243,156,18,0.2);
        }

    /* jp-brand-btn (Home) sta dentro jp-nav-bar riga 2 */
    .jp-brand-btn {
        padding: 8px 14px;
        border-bottom: none;
        align-self: stretch;
    }

    .jp-nav-admin {
        margin-left: 0;
    }
}

/* ═══════════════════════════════════════════════════════════
   RIEPILOGO ORDINE — colori per categoria
   Queste regole usano data-cat su elementi generati via JS,
   quindi NON possono stare nel CSS Isolation (Menu.cshtml.css)
   che scope-a solo gli elementi del template Razor.
═══════════════════════════════════════════════════════════ */

/* riepilogo table rules rimossi — ora tutto div-based (vedi sezioni riepilogo-cat-card e menu-pacchetto-card) */

/* ═══════════════════════════════════════════════════════════
   MENU PACCHETTO CARD — riepilogo ordine
   Card in rilievo per distinguere i menu dai prodotti singoli.
   Elementi generati via JS → non possono stare in Menu.cshtml.css
═══════════════════════════════════════════════════════════ */

.menu-pacchetto-card {
    margin: 5px 4px;
    border-radius: 14px;
    border: 1px solid var(--jp-blue-header);
    overflow: hidden;
    background: var(--jp-blue-soft);
    box-shadow: 0 6px 20px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.06);
}

.menu-pacchetto-header {
    display: flex;
    align-items: center;
    background: var(--jp-blue-header) !important;
    border-bottom: none;
    padding: 5px 10px;
    font-size: 0.68rem;
    font-weight: 800;
    color: #1a2560;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.menu-pacchetto-prezzo {
    min-width: 60px;
    text-align: right;
    font-size: 0.74rem;
    font-weight: 700;
    color: #1a2560;
    white-space: nowrap;
    flex-shrink: 0;
    padding-right: 6px;
}

.menu-pacchetto-label {
    flex: 1;
    min-width: 0;
}

.menu-pacchetto-body {
    padding: 5px 8px 7px;
}

/* Griglia orizzontale: 1 colonna per categoria (PIZZE / FRITTI / BEVANDE) */
.menu-pacchetto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 4px;
}

.menu-pacchetto-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.menu-pacchetto-col-header {
    font-size: 0.58rem;
    font-weight: 800;
    color: var(--jp-blue);
    letter-spacing: 0.3px;
    text-transform: uppercase;
    padding-bottom: 2px;
    border-bottom: 1px solid var(--jp-blue-header);
    margin-bottom: 2px;
}

.menu-pacchetto-col-item {
    font-size: 0.63rem;
    font-weight: 600;
    color: #2d2d2d;
    line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════════
   CARD PRODOTTI SINGOLI — riepilogo ordine
   Stessa estetica del menu-pacchetto-card ma per PIZZE/FRITTI/BEVANDE
═══════════════════════════════════════════════════════════ */

/* ── CARD PRODOTTI SINGOLI (PIZZE / FRITTI / BEVANDE) ─────── */
.riepilogo-cat-card {
    margin: 5px 4px;
    border-radius: 14px;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 6px 20px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.06);
}

    /* Body: tinta chiara pastello coordinata */
    .riepilogo-cat-card[data-cat="PIZZE"] {
        background: var(--jp-red-soft);
        border-color: var(--jp-red-header);
    }

    .riepilogo-cat-card[data-cat="FRITTI"] {
        background: var(--jp-amber-soft);
        border-color: var(--jp-amber-header);
    }

    .riepilogo-cat-card[data-cat="BEVANDE"] {
        background: var(--jp-forest-soft);
        border-color: var(--jp-forest-header);
    }

/* Header: tinta media soft */
.riepilogo-cat-header {
    display: flex;
    align-items: center;
    background: #bbb; /* default fallback */
    padding: 5px 10px;
    font-size: 0.68rem;
    font-weight: 800;
    color: #333;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    border-bottom: none;
}

.riepilogo-cat-nome {
    flex: 1;
    min-width: 0;
}

.riepilogo-cat-card[data-cat="PIZZE"] .riepilogo-cat-header {
    background: var(--jp-red-header);
    color: #5a1010;
}

.riepilogo-cat-card[data-cat="FRITTI"] .riepilogo-cat-header {
    background: var(--jp-amber-header);
    color: #4a3000;
}

.riepilogo-cat-card[data-cat="BEVANDE"] .riepilogo-cat-header {
    background: var(--jp-forest-header);
    color: #0e3d22;
}

.riepilogo-cat-card:not([data-cat]) .riepilogo-cat-header {
    background: #bbb;
    color: #333;
}

.riepilogo-cat-tot {
    min-width: 60px;
    text-align: right;
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    color: inherit; /* eredita il colore dall'header categoria */
}

/* Corpo card */
.riepilogo-cat-body {
    padding: 3px 10px 7px;
}

/* Sotto-header — rientro L1 */
.riepilogo-sotto-header {
    display: flex;
    align-items: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: #444;
    /*padding: 4px 0 2px 12px;*/
    border-bottom: 1px solid rgba(0,0,0,0.06);
    margin-top: 4px;
    letter-spacing: 0.2px;
}

    .riepilogo-sotto-header > span:first-child {
        flex: 1;
        min-width: 0;
    }

.riepilogo-sotto-tot {
    min-width: 60px;
    text-align: right;
    font-size: 0.72rem;
    font-weight: 600;
    color: #444;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Riga prodotto — rientro L2 con bullet */
.riepilogo-prodotto-row {
    display: flex;
    align-items: center;
    font-size: 0.65rem;
    color: #2d2d2d;
    padding: 2px 0 2px 20px; /* rientro aumentato */
    line-height: 1.6;
    border-radius: 3px;
    transition: background 0.1s;
    position: relative;
}

    .riepilogo-prodotto-row::before {
        content: "*";
        position: absolute;
        left: 15px;
        font-size: 0.60rem;
        color: #bbb;
        top: 50%;
        transform: translateY(-50%);
    }

    .riepilogo-prodotto-row.hovered-by-remove {
        background: rgba(192,57,43,0.06);
    }

.riepilogo-prod-nome {
    flex: 1;
    min-width: 0;
}

.riepilogo-prod-prezzo {
    min-width: 60px;
    text-align: right;
    white-space: nowrap;
    font-size: 0.72rem;
    font-weight: 600;
    flex-shrink: 0;
}

.riepilogo-prod-azioni {
    width: 30px;
}

/* ═══════════════════════════════════════════════════════════
   MODALE MENU — griglia prodotti 2 colonne
═══════════════════════════════════════════════════════════ */

.menu-prodotti-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    list-style: none;
    padding: 4px 0;
    margin: 0;
}

.menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #e8eaed;
    background: #fff;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    font-size: 0.80rem;
}

    .menu-item:hover {
        background: #f5f5f5;
        border-color: #ccc;
    }

    .menu-item.selected {
        background: #e8f5e9;
        border-color: var(--jp-forest);
        font-weight: 600;
        color: #1a4d2e;
    }

    .menu-item.disabled {
        opacity: 0.4;
        pointer-events: none;
        background: #f5f5f5;
    }

.modal-item-nome {
    flex: 1;
    min-width: 0;
    white-space: normal;
    line-height: 1.3;
}

.modal-item-prezzo {
    font-size: 0.75rem;
    font-weight: 700;
    color: #555;
    white-space: nowrap;
    flex-shrink: 0;
}

.menu-item.selected .modal-item-prezzo {
    color: var(--jp-forest);
}

/*BADGE-COIN*/
.badge-coin {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient( 145deg, #ffd700, #f2c200 );
    border: 4px solid #d4a800;
    /*box-shadow: 0 8px 20px rgba(0,0,0,0.35), inset 0 3px 8px rgba(255,255,255,0.8), inset 0 -6px 10px rgba(0,0,0,0.25);*/
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

    .badge-coin svg {
        position: absolute;
        width: 100%;
        height: 100%;
    }

.coin-text {
    fill: #198754;
    font-weight: 800;
    font-size: 25px;
    /*letter-spacing: 4px;*/
}

.badge-promo {
    position: absolute;
    right: 50%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
}

@keyframes floatBadge {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }

    100% {
        transform: translateY(0);
    }
}

.link-animato {
    display: inline-block; /* Permette al pseudo-elemento di posizionarsi correttamente */
    position: relative; /* Contenitore per il pseudo-elemento */
    color: var(--jp-orange); /* Colore del testo di esempio */
    text-decoration: none; /* Rimuove la sottolineatura di default */
    overflow: hidden; /* Nasconde la parte del pseudo-elemento fuori dai bordi */
    padding-bottom: 2px; /* Spazio tra testo e sottolineatura */
}

    .link-animato::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0; /* Partenza da sinistra */
        width: 100%; /* L'elemento copre tutta la larghezza del link */
        height: 2px; /* Spessore della sottolineatura */
        background-color: var(--jp-orange); /* Colore della sottolineatura */
        transform: scaleX(0); /* Inizialmente non visibile (larghezza zero) */
        transform-origin: bottom left; /* Punto di origine dell'espansione (da sinistra) */
        transition: transform 0.3s ease-out; /* Animazione della scala */
    }

    .link-animato:hover::after {
        transform: scaleX(1); /* Espande al 100% al passaggio del mouse */
    }

    /* Variante: espansione dal centro */
    .link-animato.centro::after {
        transform-origin: bottom center; /* Punto di origine al centro */
    }

/* ═══════════════════════════════════════════════════════════
   MOBILE GLOBAL — regole che devono avere scope globale
   (non possono stare in CSS Isolation perché agiscono su
   elementi generati da JS o su contenitori del layout)
═══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {

    /* Sblocca overflow per permettere position:sticky */
    .jp-main-wrap {
        overflow: visible !important;
        overflow-y: visible !important;
    }

    /* Nascondi badge minimo — scope globale necessario
       perché l'elemento è generato da JS */
    #minimoMsg,
    .minimo-badge-float {
        display: none !important;
        visibility: hidden !important;
    }
}

@media (max-width: 576px) {
    .jp-hero-title {
        flex: 1;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 1.3rem;
    }

    .free-badge-float {
        flex-shrink: 0;
        white-space: nowrap;
    }

        .free-badge-float span {
            font-size: 0.7rem;
        }

        .free-badge-float i {
            font-size: 0.9rem;
        }
}
/* ===== MOBILE FIRST =====
   FIX (A): la regola base NON usa più position:absolute.
   Su mobile ≤720px il badge è in flusso nell'header (gestito nel @media sopra).
   Su tablet/desktop lo sovrascrivono le regole successive.
*/
.delivery-badge {
    position: static; /* default: in flusso */
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(34, 34, 34, 0.95);
    color: #fff;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    z-index: 1050;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

/* Riga */
.delivery-line {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

    .delivery-line .icon {
        font-size: 14px;
    }


/* ===== TABLET ===== */
@media (min-width: 768px) {
    .delivery-badge {
        padding: 10px 16px;
        font-size: 14px;
    }

    .delivery-line .icon {
        font-size: 15px;
    }
}


/* ===== DESKTOP ===== */
@media (min-width: 1024px) {
    .delivery-badge {
        position: fixed;
        top: auto;
        bottom: 20px;
        right: 20px;
        flex-direction: row;
        gap: 12px;
        border-radius: 999px;
        padding: 10px 18px;
        z-index: 2000;
    }
}
