/* =====================================================================
   NoMorePaper customerapps — stylesheet condiviso
   QRCart / Dining / Waiter / Inventory (mobile-first, palette VERDE NMP)
   Coerente col vecchio webapp/qrcart/index.html
   ===================================================================== */

:root {
    /* Palette NMP brand (aligned con marketplace) */
    --green:        #488831;  /* NMP medium */
    --green-dark:   #175206;  /* NMP scuro */
    --green-soft:   #6dbf4a;  /* NMP light */
    --green-glow:   #a3ff7e;  /* highlight neon */
    --green-light:  #eaf5e2;  /* mint tenue, matching shop hero */
    --green-wash:   #d9ecc8;  /* gradient header/footer marketplace */
    --cta:          #f57c00;  /* arancio ambra: bottoni-azione (contrasto sul verde) */
    --cta-dark:     #e65100;  /* arancio scuro: stato :active */
    --bg:           #f6faf2;  /* body avorio verdognolo */
    --card:         #ffffff;
    --text:         #1a2e16;
    --muted:        #6b7864;
    --border:       #d4dccd;
    --danger:       #dc2626;
    --warn:         #f59e0b;
    --info:         #38bdf8;
}

/* Colore dei tasti-azione (--cta) legato al CANALE: combacia col banner in alto.
   self=verde, tavolo=teal, take-away=ambra, delivery=indaco. */
body.flow-self     { --cta: #6d28d9; --cta-dark: #5b21b6; }
body.flow-table    { --cta: #00897b; --cta-dark: #00695c; }
body.flow-takeaway { --cta: #f57c00; --cta-dark: #e65100; }
body.flow-delivery { --cta: #3949ab; --cta-dark: #283593; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.45;
    display: flex;
    flex-direction: column;
}

img { max-width: 100%; height: auto; display: block; }
video, svg { max-width: 100%; height: auto; }

/* iOS zoom prevention sui form: input/select <16px scatena zoom auto */
@media (max-width: 600px) {
    input[type=text], input[type=search], input[type=email],
    input[type=tel], input[type=number], input[type=password],
    input[type=date], select, textarea {
        font-size: 16px !important;
    }
}

/* Touch fallback per hover-only: mostra sempre azioni nascoste su touch */
@media (hover: none) {
    .ca-recent-item .rx { display: inline-flex !important; }
}
a { color: var(--green-dark); }

/* ─── Header (sticky, branding shop + logo cliccabile = home) ─── */
.ca-header {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: #fff;
    padding: 10px 14px;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    flex-shrink: 0;   /* il body è flex in colonna alto 100%: senza, al telefono la testata si schiacciava e il nome usciva */
}
/* CHG-041: riga logo | colonna(nome+meta / stelline) — il logo si centra in
   verticale sull'INTERO blocco, le stelline si allineano da sole al nome. */
.ca-header .ca-hgroup {
    display: flex; flex-direction: row; align-items: center;
    gap: 10px; flex: 1; min-width: 0;
}
.ca-header .ca-hcol {
    display: flex; flex-direction: column; align-items: flex-start;
    gap: 2px; flex: 1; min-width: 0;
}
.ca-header .ca-logo-link {
    display: flex; align-items: center;
    text-decoration: none; color: #fff; flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.ca-header .ca-logo-link:active { opacity: .85; }
.ca-header .ca-htext-link {
    display: block; max-width: 100%; min-width: 0; overflow: hidden;
    text-decoration: none; color: #fff;
    -webkit-tap-highlight-color: transparent;
}
.ca-header .ca-htext-link:active { opacity: .85; }
.ca-header .ca-logo {
    width: 44px; height: 44px;
    background: rgba(255,255,255,.18);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    overflow: hidden;
}
.ca-header .ca-logo img { width: 44px; height: 44px; object-fit: cover; border-radius: 10px; background: #fff; }
/* CHG-1406 (Luke 16/10: il logo «sta già in alto … si potrebbe solo ingrandire quello un po'» · «aumenta altezza fascia
   anche»): su desktop logo 60 px e barra 80 px (era 64); il percorso (.ca-breadcrumb, sticky) si attacca sotto a 80 */
@media (min-width: 900px) {
    .ca-header { min-height: 80px; }
    .ca-header .ca-logo { width: 60px; height: 60px; border-radius: 12px; }
    .ca-header .ca-logo img { width: 60px; height: 60px; border-radius: 12px; }
}
.ca-header .ca-htext { flex: 1; min-width: 0; }
.ca-header .ca-shop-name {
    font-size: 16px; font-weight: 600; line-height: 1.2;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ca-header .ca-shop-meta {
    font-size: 11px; opacity: .85; margin-top: 1px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ca-header .ca-shop-rating {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; color: #fff;
    /* CHG-041: vive dentro .ca-hcol → già allineato al nome, niente margini magici */
}
.ca-header .ca-shop-rating .ca-stars { color: #ffd54f; letter-spacing: 1px; font-size: 13px; }
.ca-header .ca-shop-rating .ca-rating-n { opacity: .8; }
/* Versione cliccabile → vista lista recensioni: sottolineatura tenue + cursore */
.ca-header a.ca-shop-rating-link {
    text-decoration: none; cursor: pointer;
    border-bottom: 1px dotted rgba(255,255,255,.55);
    padding-bottom: 1px;
    -webkit-tap-highlight-color: transparent;
}
.ca-header a.ca-shop-rating-link:hover,
.ca-header a.ca-shop-rating-link:active { border-bottom-color: rgba(255,255,255,.9); opacity: .92; }
.ca-header .ca-cart-icon {
    width: 44px; height: 44px; border-radius: 10px;
    background: rgba(255,255,255,.18);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; text-decoration: none; color: #fff;
    position: relative; flex-shrink: 0;
}
.ca-header .ca-cart-badge {
    position: absolute; top: -4px; right: -4px;
    background: #ff5722; color: #fff;
    font-size: 11px; font-weight: 700;
    padding: 1px 6px; border-radius: 10px;
    min-width: 18px; text-align: center;
}

/* ─── Breadcrumb (sotto header, sticky-companion) ─── */
.ca-breadcrumb {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.4;
    color: var(--muted);
    position: sticky;
    top: 64px;             /* sotto header sticky */
    z-index: 9;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.ca-breadcrumb a {
    color: var(--green-dark);
    text-decoration: none;
    font-weight: 600;
}
.ca-breadcrumb a:hover,
.ca-breadcrumb a:active { text-decoration: underline; }
.ca-breadcrumb .sep {
    margin: 0 8px;
    color: #bbb;
}
.ca-breadcrumb .current {
    color: var(--text);
    font-weight: 600;
}
@media (max-width: 480px) {
    .ca-breadcrumb { top: 60px; padding: 10px 12px; font-size: 13px; }
}
/* CHG-1406d: sotto la barra alta 80 px su desktop (qui, DOPO la regola base: a parità vince l'ultima) */
@media (min-width: 900px) { .ca-breadcrumb { top: 80px; } }

/* ─── Main + container ─── */
.ca-main {
    flex: 1;
    padding: 14px;
    padding-bottom: 90px;  /* spazio per total bar floating */
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
}

/* ─── Footer NMP brand (allineato a .mp-footer del marketplace) ─── */
.ca-footer {
    background: linear-gradient(180deg, var(--green-wash) 0%, #c1dba8 100%);
    color: #2f4029;
    border-top: 3px solid var(--green);
    padding: 22px 16px;
    margin-top: auto;
    font-size: 13px;
}
.ca-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}
.ca-footer-left strong { color: var(--green-dark); font-size: 15px; }
.ca-footer-left sup { font-size: .55em; vertical-align: super; }
.ca-footer-left small { color: #6b7864; font-size: 12px; }
/* CHG-2050 VET-31 (D-261): il lockup chiaro col tondo e l'ondina al posto della scritta; la riga sotto parte dalla scritta
   (CHG-2134, D-266: con le onde a sinistra a 188/130 dell'altezza, 58 px a 40 px) */
.ca-footer-left .ca-lockup { display: block; width: auto; height: 40px; max-width: 100%; margin-bottom: 1px; }
.ca-footer-left .ca-lockup + small { display: block; padding-left: 58px; }
.ca-footer-links {
    background: #a8c993;
    border: 1px solid #82b06b;
    border-radius: 10px;
    padding: 8px 14px;
    display: flex; align-items: center; flex-wrap: wrap;
}
.ca-footer-links a {
    margin-left: 16px;
    color: #14241a;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: color .15s;
}
.ca-footer-links a:first-child { margin-left: 0; }
.ca-footer-links a:hover { color: var(--green-dark); }
@media (max-width: 600px) {
    .ca-footer-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
    .ca-footer-links { padding: 7px 12px; }
    .ca-footer-links a { margin: 0 10px 0 0; }
    .ca-footer-links a:first-child { margin-left: 0; }
}

/* ─── Flow hint (stepper 3-passi self-checkout) ─── */
.ca-flow-hint {
    background: var(--green-light);
    border: 1px solid #c8e6c9;
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 14px;
    display: flex;
    align-items: stretch;
    gap: 4px;
    font-size: 12px;
    color: var(--green-dark);
}
.ca-flow-hint .step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 4px;
    border-radius: 8px;
    text-align: center;
    line-height: 1.2;
    transition: background .15s;
}
.ca-flow-hint .step.current {
    background: var(--green);
    color: #fff;
    font-weight: 600;
}
.ca-flow-hint .step .ic { font-size: 20px; }
.ca-flow-hint .step .t { font-size: 11px; }
.ca-flow-hint .arr {
    align-self: center;
    color: #aaa;
    font-size: 16px;
}
.ca-flow-hint .ca-flow-close {
    align-self: flex-start;
    border: 0;
    background: transparent;
    color: var(--green-dark);
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    line-height: 1;
    margin-left: 4px;
}
.ca-flow-hint .ca-flow-close:active { background: rgba(0,0,0,.08); }
@media (max-width: 360px) {
    .ca-flow-hint .step .t { display: none; }
    .ca-flow-hint .step { padding: 6px 8px; }
}

/* ─── Welcome banner ─── */
.ca-banner-welcome {   /* il riquadro (forma, colori, piega) e' di webapp/css/nmp-nota.css */
    margin-bottom: 14px;
    font-size: 14px;
    line-height: 1.5;
}

/* ─── Cards ─── */
.ca-card {
    background: var(--card);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
    padding: 16px;
    margin-bottom: 12px;
}
.ca-card h2 {
    font-size: 16px;
    color: var(--green-dark);
    margin-bottom: 10px;
}
.ca-card p { color: #444; font-size: 14px; }

/* ─── Bottoni touch-friendly (48px+) ─── */
.ca-btn {
    display: inline-block;
    min-height: 48px;
    padding: 13px 22px;
    border-radius: 10px;
    border: 0;
    background: var(--cta);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background .15s;
}
.ca-btn:active { background: var(--cta-dark); }
.ca-btn.full { width: 100%; }
.ca-btn.secondary {
    background: #fff;
    color: var(--green-dark);
    border: 1.5px solid var(--green);
}
.ca-btn.secondary:active { background: var(--green-light); color: var(--green-dark); }
.ca-btn.ghost { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.ca-btn.ghost:active { background: #f0f0f0; }
.ca-btn.danger { background: var(--danger); }
.ca-btn.danger:active { background: #8a1818; }
.ca-btn:disabled { opacity: .5; cursor: not-allowed; }
/* Bottoni utility (filtri/paginazione) restano verdi: l'ambra è riservata
   alle azioni d'acquisto (Aggiungi / Vedi carrello / Conferma / Paga). */
.ca-filters .ca-btn, .ca-pager .ca-btn { background: var(--green); }
.ca-filters .ca-btn:active, .ca-pager .ca-btn:active { background: var(--green-dark); }

/* ─── Liste tap-elements (landing menu cards) ─── */
.ca-list { list-style: none; }
.ca-list-item {
    background: var(--card);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    min-height: 60px;
    -webkit-tap-highlight-color: transparent;
}
.ca-list-item:active { background: #f0f0f0; }
.ca-list-item .icon { font-size: 28px; }
.ca-list-item .text { flex: 1; }
.ca-list-item .text .title { font-weight: 600; font-size: 15px; color: var(--text); }
.ca-list-item .text .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ca-list-item .arrow { color: #999; font-size: 22px; flex-shrink: 0; }

.ca-list-item.ca-list-primary {
    background: var(--green);
    color: #fff;
    box-shadow: 0 4px 14px rgba(46,125,50,.28);
}
.ca-list-item.ca-list-primary:active { background: var(--green-dark); }
.ca-list-item.ca-list-primary .text .title { color: #fff; }
.ca-list-item.ca-list-primary .text .meta { color: rgba(255,255,255,.85); }
.ca-list-item.ca-list-primary .arrow { color: rgba(255,255,255,.7); }

.ca-list-item.ca-list-secondary {
    background: transparent;
    border: 1px dashed var(--border);
    box-shadow: none;
    opacity: .85;
}
.ca-list-item.ca-list-secondary .text .title { font-size: 14px; }
.ca-list-item.ca-list-secondary .text .meta { font-size: 11px; }
.ca-list-item.ca-list-secondary .icon { font-size: 22px; opacity: .7; }

/* ─── Tile landing (nuovo look card-based) ─── */
.ca-tiles {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 8px 0;
}
.ca-tiles-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}
.ca-tile {
    background: var(--card);
    border-radius: 14px;
    padding: 16px;
    display: grid;
    grid-template-columns: 56px 1fr auto;
    align-items: center;
    gap: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--border);
    transition: transform .15s, box-shadow .15s, border-color .15s;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
}
.ca-tile:hover {
    box-shadow: 0 6px 18px rgba(0,0,0,.12);
    border-color: var(--green-light);
    transform: translateY(-1px);
}
.ca-tile:active { transform: scale(.98); }
.ca-tile .ic {
    width: 56px; height: 56px;
    border-radius: 14px;
    /* Colore brand per-azione (come i box su /shop/seller): --tic-bg sfondo tenue,
       --tic-ac colore icona (gli SVG usano currentColor). Fallback = verde di default;
       il tile .primary mantiene il suo sfondo/colore (regola più specifica sotto). */
    background: var(--tic-bg, var(--green-light));
    color: var(--tic-ac, inherit);
    display: flex; align-items: center; justify-content: center;
    font-size: 30px;
    flex-shrink: 0;
}
.ca-tile .tx { min-width: 0; }
.ca-tile .tx .t {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 3px;
    line-height: 1.25;
}
.ca-tile .tx .m {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.35;
}
.ca-tile .arr {
    color: #bbb;
    font-size: 26px;
    flex-shrink: 0;
}

/* PRIMARY: hero card verde pieno, alta, evidenziata */
.ca-tile.primary {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: #fff;
    border-color: var(--green-dark);
    box-shadow: 0 6px 18px rgba(46,125,50,.32);
    padding: 22px 18px;
    grid-template-columns: 64px 1fr auto;
    gap: 16px;
}
.ca-tile.primary:hover {
    box-shadow: 0 10px 28px rgba(46,125,50,.42);
    border-color: var(--green-dark);
}
.ca-tile.primary .ic {
    background: rgba(255,255,255,.20);
    width: 64px; height: 64px;
    font-size: 34px;
    border-radius: 16px;
}
.ca-tile.primary .tx .t { color: #fff; font-size: 18px; }
.ca-tile.primary .tx .m { color: rgba(255,255,255,.92); font-size: 13px; }
.ca-tile.primary .arr { color: rgba(255,255,255,.75); font-size: 30px; }

/* Tile interna a una row (2 colonne) — più compatta, icona sopra */
.ca-tiles-row .ca-tile {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    text-align: center;
    padding: 16px 12px;
    gap: 8px;
}
.ca-tiles-row .ca-tile .ic {
    margin: 0 auto;
    width: 52px; height: 52px;
    font-size: 26px;
}
.ca-tiles-row .ca-tile .tx .t { font-size: 14px; }
.ca-tiles-row .ca-tile .tx .m { font-size: 11px; }
.ca-tiles-row .ca-tile .arr { display: none; }
/* CHG-934 → CHG-1395 (Luke 16/10: «takeaway perché sta sotto da solo?»). Prima: griglia auto-fit (4 colonne sul
   computer) e, con le modalità in numero dispari, l'ultima a riga intera → due schede strette in alto e il take-away
   da solo sotto. Ora le modalità stanno tutte su UNA riga, quante sono (--n lo scrive la pagina); al telefono, con
   tre, diventano compatte: icona e titolo, senza la riga di spiegazione. */
.ca-tiles-row { grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); }
.ca-tiles-row .ca-tile { align-content: start; }   /* icone e titoli in fila anche se i testi hanno lunghezze diverse */
@media (max-width: 599px) {
    .ca-tiles-row[data-n="3"] { gap: 8px; }
    .ca-tiles-row[data-n="3"] .ca-tile { padding: 12px 6px; gap: 6px; }
    .ca-tiles-row[data-n="3"] .ca-tile .ic { width: 44px; height: 44px; font-size: 22px; }
    .ca-tiles-row[data-n="3"] .ca-tile .tx .t { font-size: 13px; line-height: 1.2; }
    .ca-tiles-row[data-n="3"] .ca-tile .tx .m { display: none; }
}

/* MINI: card più piccola e attenuata (per "Info & contatti") */
.ca-tile.mini {
    padding: 10px 12px;
    grid-template-columns: 36px 1fr auto;
    gap: 10px;
    background: transparent;
    border-style: dashed;
    box-shadow: none;
    opacity: .92;
}
.ca-tile.mini:hover { background: var(--card); opacity: 1; }
.ca-tile.mini .ic {
    width: 36px; height: 36px;
    font-size: 18px;
    background: #f5f5f5;
    border-radius: 10px;
}
.ca-tile.mini .tx .t { font-size: 13px; }
.ca-tile.mini .tx .m { font-size: 11px; }
.ca-tile.mini .arr { font-size: 18px; }

@media (max-width: 480px) {
    .ca-tile { padding: 14px; gap: 12px; }
    .ca-tile.primary { padding: 18px 14px; }
    .ca-tile .ic { width: 50px; height: 50px; font-size: 26px; }
    .ca-tile.primary .ic { width: 58px; height: 58px; font-size: 30px; }
    .ca-tile .tx .t { font-size: 15px; }
    .ca-tile .tx .m { font-size: 12px; }
}

/* ─── Filtri (search + select + button) ─── */
.ca-filters {
    background: var(--card);
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 14px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: stretch;
}
.ca-filters input[type=search],
.ca-filters select {
    min-width: 0;            /* evita overflow flex: prima la select a destra veniva tagliata */
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    box-sizing: border-box;
}
/* Ricerca a tutta larghezza su riga propria; categoria + Filtra vanno sotto. */
.ca-filters input[type=search] { flex: 1 1 100%; }
.ca-filters select { flex: 1 1 140px; }
.ca-filters input[type=search]:focus,
.ca-filters select:focus {
    outline: 2px solid var(--green);
    outline-offset: -2px;
}
.ca-filters .ca-btn { min-height: 44px; padding: 10px 18px; font-size: 14px; }

/* ─── Highlight match nel live filter ─── */
.ca-prod-card mark { background: #fff59d; color: inherit; padding: 0 1px; border-radius: 2px; }
.ca-prod-card .ca-prod-open { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ca-prod-card .ca-prod-open:active { opacity: .85; }

/* ─── Modale scheda prodotto (override del .ca-modal-content base) ─── */
.ca-product-detail {
    max-width: 480px;
    width: 100%;
    text-align: left;
    position: relative;
    padding: 0;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
/* ─── Modale overlay (condiviso) ─── */
.ca-modal {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.ca-modal[hidden] { display: none; }

/* Reset globale: l'attributo HTML hidden deve sempre prevalere su display: flex/grid/block.
   (alcuni nostri componenti hanno display custom che altrimenti sovrascrive hidden) */
[hidden] { display: none !important; }
.ca-modal-content {
    background: var(--card);
    border-radius: 14px;
    padding: 22px 18px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.ca-modal-close {
    position: absolute;
    top: 10px; right: 10px;
    border: 0;
    background: rgba(255,255,255,.96);
    width: 36px; height: 36px;
    border-radius: 50%;
    font-size: 18px;
    color: var(--text);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
    z-index: 2;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
    transition: transform .15s, background .15s;
}
.ca-modal-close:hover { transform: scale(1.08); }
.ca-modal-close .ca-ico { width: 22px; height: 22px; }
.ca-modal-close:active { background: #f0f0f0; transform: scale(.95); }

/* Scheda prodotto: body scrollabile + footer sticky */
.ca-pd-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px 18px 8px;
}
.ca-pd-img {
    width: 100%;
    height: 200px;
    background: var(--green-light) center / cover no-repeat;
    border-radius: 12px;
    margin-bottom: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 64px;
    color: #aaa;
    flex-shrink: 0;
}
/* Emoji-categoria nella scheda prodotto: icona centrata, non a tutta altezza */
.ca-pd-img.is-emoji { background-size: 130px; background-color: #faf7f1; }

/* ─── Galleria immagini prodotto nel modal (slider + zoom) ───
   Replica adattata al pop-up della galleria del marketplace (shop/product.php).
   Mobile-first, tema verde NMP. [[project-marketplace-product-gallery]] */
.ca-prod-gallery { margin-bottom: 14px; }
.ca-prod-gallery .ca-pd-img { margin-bottom: 0; }
/* Quando c'è una foto vera la principale è "ingrandibile" (apre il lightbox). */
.ca-prod-gallery-main.has-image { cursor: zoom-in; }
.ca-prod-gallery-main { transition: filter .12s; }
.ca-prod-gallery-main.has-image:active { filter: brightness(.94); }
.ca-prod-thumbs {
    display: flex; gap: 8px; margin-top: 10px;
    overflow-x: auto; padding-bottom: 2px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.ca-prod-thumbs::-webkit-scrollbar { display: none; }
.ca-prod-thumb {
    flex: 0 0 auto;
    width: 56px; height: 56px;
    border-radius: 9px;
    border: 2px solid var(--border);
    background-size: cover; background-position: center;
    cursor: pointer; padding: 0;
    transition: border-color .15s, transform .12s;
    -webkit-tap-highlight-color: transparent;
}
.ca-prod-thumb.is-active { border-color: var(--green); }
.ca-prod-thumb:active { transform: scale(.94); }

/* Lightbox a tutto schermo: zoom + swipe + frecce. */
.ca-prod-lightbox {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.9);
    z-index: 200;
    display: flex; align-items: center; justify-content: center;
    overscroll-behavior: contain;
}
.ca-prod-lightbox[hidden] { display: none; }
.ca-lb-img {
    max-width: 92vw; max-height: 84vh;
    object-fit: contain;
    transform: scale(1); transition: transform .15s;
    cursor: zoom-in; user-select: none; -webkit-user-drag: none;
    touch-action: none;
}
.ca-lb-close .ca-ico { width: 24px; height: 24px; }
.ca-lb-close {
    position: absolute; top: 14px; right: 16px;
    width: 42px; height: 42px;
    border: 0; border-radius: 50%;
    background: rgba(255,255,255,.16); color: #fff;
    font-size: 19px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.ca-lb-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 48px; height: 48px;
    border: 0; border-radius: 50%;
    background: rgba(255,255,255,.16); color: #fff;
    font-size: 30px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.ca-lb-prev { left: 14px; }
.ca-lb-next { right: 14px; }
.ca-lb-zoom {
    position: absolute; bottom: 18px; left: 50%;
    transform: translateX(-50%);
    display: flex; gap: 10px;
}
.ca-lb-zoom button {
    width: 46px; height: 40px;
    border: 0; border-radius: 8px;
    background: rgba(255,255,255,.16); color: #fff;
    font-size: 22px; line-height: 1; cursor: pointer;
}

.ca-pd-name {
    color: var(--green-dark);
    font-size: 20px;
    margin-bottom: 6px;
    line-height: 1.25;
}
.ca-pd-cat {
    display: inline-block;
    background: var(--green-light);
    color: var(--green-dark);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.ca-pd-desc {
    color: #333;
    font-size: 14px;
    line-height: 1.55;
    margin-bottom: 14px;
    white-space: pre-line;
}
.ca-pd-meta {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-bottom: 12px;
}
.ca-pd-meta span {
    background: #f5f5f5;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 12px;
    color: #444;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.ca-pd-allergens {   /* il riquadro (forma, colori, piega) e' di webapp/css/nmp-nota.css */
    margin-bottom: 14px;
    font-size: 13px;
    line-height: 1.4;
}
.ca-pd-conflict {   /* il riquadro (forma, colori, piega) e' di webapp/css/nmp-nota.css */
    margin-bottom: 14px;
    font-size: 13px;
    line-height: 1.45;
}

/* Banner tavolo (sticky sotto breadcrumb, visibile in catalog/cart flow=table) */
.ca-table-banner {
    background: var(--green);
    color: #fff;
    padding: 8px 12px;
    border-radius: 10px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    box-shadow: 0 2px 6px rgba(46,125,50,.18);
}
.ca-table-banner .ic { font-size: 18px; }
.ca-table-banner .tx { flex: 1; }
.ca-table-banner .tx strong { color: #fff; }
.ca-table-banner .muted { color: rgba(255,255,255,.85); }
.ca-table-banner .exit {
    color: rgba(255,255,255,.9);
    text-decoration: none;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255,255,255,.15);
    line-height: 1;
}
.ca-table-banner .exit:active { background: rgba(255,255,255,.3); }

/* Banner per takeaway / delivery (mode arancione, no exit link) */
.ca-mode-banner {
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
}
.ca-mode-banner .ic { font-size: 22px; }
.ca-mode-banner.mode-takeaway {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: #fff;
}
.ca-mode-banner.mode-delivery {
    background: linear-gradient(135deg, #5c6bc0 0%, #3949ab 100%);
    color: #fff;
}
.ca-mode-banner.mode-takeaway strong,
.ca-mode-banner.mode-delivery strong { color: #fff; }

/* ─── Hero di sezione "waho" (self/tavolo/asporto/consegna) ───
   Banner a tema con illustrazione SVG sfumata di sfondo + titolo/sottotitolo. */
.ca-mode-hero {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    padding: 20px 22px;
    margin-bottom: 14px;
    min-height: 116px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,.16);
}
.ca-mode-hero .ca-mh-illu {
    position: absolute;
    right: 6px;
    bottom: -2px;
    width: 160px;
    height: 120px;
    opacity: .82;
    pointer-events: none;
}
@media (max-width: 480px) {
    .ca-mode-hero { min-height: 104px; padding: 18px; }
    .ca-mode-hero .ca-mh-illu { width: 132px; height: 100px; opacity: .82; }
}
.ca-mode-hero .ca-mh-illu svg { width: 100%; height: 100%; }
.ca-mode-hero .ca-mh-text { position: relative; z-index: 1; flex: 1; min-width: 0; max-width: calc(100% - 148px); }
@media (max-width: 480px) { .ca-mode-hero .ca-mh-text { max-width: calc(100% - 120px); } }
.ca-mode-hero .ca-mh-title {
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -.01em;
    line-height: 1.12;
    text-shadow: 0 1px 3px rgba(0,0,0,.28);
}
.ca-mode-hero .ca-mh-sub {
    font-size: 12.5px;
    opacity: .96;
    margin-top: 3px;
    line-height: 1.3;
    text-shadow: 0 1px 2px rgba(0,0,0,.18);
}
.ca-mode-hero .ca-mh-exit {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    width: 38px; height: 38px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.22);
    border: 1px solid rgba(255,255,255,.4);
    color: #fff; text-decoration: none; font-size: 18px;
}
.ca-mode-hero .ca-mh-exit:active { background: rgba(255,255,255,.34); }
.ca-mode-hero.flow-self     { background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%); }
.ca-mode-hero.flow-table    { background: linear-gradient(135deg, #00897b 0%, #26a69a 100%); }
.ca-mode-hero.flow-takeaway { background: linear-gradient(135deg, #fb8c00 0%, #f57c00 100%); }
.ca-mode-hero.flow-delivery { background: linear-gradient(135deg, #5c6bc0 0%, #3949ab 100%); }

/* ─── Hero di benvenuto della home shop (landing QRCart) ─── */
.ca-home-hero {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    padding: 18px 20px;
    margin: 4px 0 14px;
    min-height: 92px;
    display: flex;
    align-items: center;
    color: #fff;
    background: linear-gradient(135deg, #175206 0%, #2e7d32 55%, #66bb6a 100%);
    box-shadow: 0 4px 16px rgba(23,82,6,.22);
}
.ca-home-hero .ca-hh-illu {
    position: absolute;
    right: 2px; bottom: -4px;
    width: 140px; height: 96px;
    opacity: .20;
    pointer-events: none;
}
.ca-home-hero .ca-hh-illu svg { width: 100%; height: 100%; }
.ca-home-hero .ca-hh-text { position: relative; z-index: 1; min-width: 0; }
.ca-home-hero .ca-hh-eyebrow {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1.2px; opacity: .85;
}
.ca-home-hero .ca-hh-title {
    font-size: 22px; font-weight: 800; letter-spacing: -.02em;
    line-height: 1.1; margin-top: 1px;
    text-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.ca-home-hero .ca-hh-sub {
    font-size: 13px; opacity: .96; margin-top: 5px;
    line-height: 1.35; max-width: 88%;
    text-shadow: 0 1px 2px rgba(0,0,0,.2);
}

/* ─── Form raccolta cliente per takeaway/delivery (cart.php flow=takeaway|delivery) ─── */
.ca-order-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}
/* Layout label-sopra-input: applicato sia nei form ordine sia nei modali (es. login customer).
   Il login modal in cart.php usa .ca-of-row DENTRO .ca-modal-content, NON dentro .ca-order-form,
   quindi serve un selettore aggiuntivo per ereditare lo stesso layout column. */
.ca-order-form .ca-of-row,
.ca-modal-content .ca-of-row { display: flex; flex-direction: column; gap: 4px; }
.ca-modal-content .ca-of-row { margin-bottom: 10px; }
.ca-modal-content .ca-of-row .lab {
    font-size: 12px; color: #666; font-weight: 500;
}
.ca-modal-content .ca-of-row input {
    padding: 10px 12px; border: 1px solid #d0d0d0; border-radius: 6px;
    font-size: 14px; width: 100%; box-sizing: border-box;
}
.ca-modal-content .ca-of-row input:focus {
    outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(67, 160, 71, .15);
}
.ca-order-form .ca-of-row .lab {
    font-size: 12px;
    color: var(--green-dark);
    font-weight: 600;
}
.ca-order-form .ca-of-row input,
.ca-order-form .ca-of-row select,
.ca-order-form .ca-of-row textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    background: #fff;
    box-sizing: border-box;
}
.ca-order-form .ca-of-row input:focus,
.ca-order-form .ca-of-row select:focus,
.ca-order-form .ca-of-row textarea:focus {
    outline: 2px solid var(--green);
    outline-offset: -2px;
}
.ca-order-form .ca-of-row textarea {
    resize: vertical;
    min-height: 48px;
}
.ca-order-form .ca-of-row-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 8px;
}
.ca-order-form .ca-of-row-grid label { display: flex; flex-direction: column; gap: 4px; }
.ca-order-form .ca-of-row-grid .lab {
    font-size: 12px;
    color: var(--green-dark);
    font-weight: 600;
}
.ca-order-form .ca-of-row-grid input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
}
.ca-order-form .ca-of-row-grid input:focus {
    outline: 2px solid var(--green);
    outline-offset: -2px;
}

/* Nota item nel carrello */
.ca-cart-row .info .item-note {
    font-size: 12px;
    color: var(--green-dark);
    margin-top: 4px;
    line-height: 1.3;
}
.ca-cart-row .info .item-note em { font-style: italic; color: #555; }
.ca-cart-row .info .item-note .note-edit,
.ca-cart-row .info .item-note .note-add {
    border: 0;
    background: transparent;
    color: var(--green-dark);
    cursor: pointer;
    padding: 2px 6px;
    font-size: 12px;
    border-radius: 4px;
    font-weight: 600;
}
.ca-cart-row .info .item-note .note-edit:hover,
.ca-cart-row .info .item-note .note-add:hover { background: var(--green-light); }
.ca-cart-row .info .item-note.muted-note { color: var(--muted); }
.ca-cart-row .info .item-note.muted-note .note-add { color: var(--muted); }
.ca-cart-row .info .item-note .note-add .ca-ico { width: 13px; height: 13px; margin-right: 3px; vertical-align: -2px; }

/* Banner dietary nel cart */
.ca-cart-dietary {   /* il riquadro (forma, colori, piega) e' di webapp/css/nmp-nota.css */
    margin-bottom: 10px;
    font-size: 13px;
    line-height: 1.4;
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.ca-cart-dietary .flags {
    display: flex; flex-wrap: wrap; gap: 6px;
    flex: 1; min-width: 200px;
}
.ca-cart-dietary .flags .flag {
    background: #fff; border: 1px solid #f57c00; color: #6a4c00;
    padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.ca-cart-dietary .edit {
    color: #6a4c00; text-decoration: underline; font-size: 12px;
}

/* Nota tavolo nel cart */
.ca-cart-tablenote {   /* il riquadro (forma, colori, piega) e' di webapp/css/nmp-nota.css */
    margin-bottom: 10px;
    font-size: 13px;
    line-height: 1.4;
}
.ca-cart-tablenote .txt { margin-left: 6px; color: #333; font-style: italic; }
.ca-pd-extras {
    border-top: 1px dashed var(--border);
    margin-top: 6px;
    padding: 10px 0 4px;
    font-size: 12px;
    color: var(--muted);
    display: flex; flex-direction: column; gap: 4px;
}
.ca-pd-extras .row { display: flex; justify-content: space-between; gap: 12px; }
.ca-pd-extras .row .k { font-weight: 600; color: #555; }
.ca-pd-extras .row .v { color: #333; font-family: 'Courier New', monospace; }

.ca-pd-foot {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px 14px;
    background: var(--card);
    border-top: 1px solid var(--border);
}
.ca-pd-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--green-dark);
    flex-shrink: 0;
}
.ca-pd-add { flex: 1; }

/* Legacy: .ca-pd-bottom resta valido se modale "vecchio" caricato dalla cache */
.ca-pd-bottom {
    display: flex; align-items: center; gap: 12px;
    margin-top: 12px; padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* ─── Spinner inline (durante fetch ricerca) ─── */
.ca-search-spin {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid var(--green-light);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: ca-spin 0.7s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}
@keyframes ca-spin { to { transform: rotate(360deg); } }

/* ─── Visti di recente (carousel orizzontale prodotti, compatto) ─── */
.ca-recent-prods {
    margin: 12px 0;
    background: var(--card);
    border-radius: 10px;
    padding: 8px 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.ca-recent-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.ca-recent-head h3 {
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.ca-recent-nav { display: flex; gap: 4px; }
.ca-recent-nav .rnav {
    width: 24px; height: 24px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--green-light);
    color: var(--green-dark);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}
.ca-recent-nav .rnav:active { background: var(--green); color: #fff; }
.ca-recent-nav .rnav:disabled { opacity: .3; cursor: not-allowed; }

.ca-recent-track {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 2px 0;
    scrollbar-width: thin;
}
.ca-recent-track::-webkit-scrollbar { height: 4px; }
.ca-recent-track::-webkit-scrollbar-thumb {
    background: var(--border); border-radius: 3px;
}

.ca-recent-item {
    flex: 0 0 72px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    cursor: pointer;
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow: hidden;
    background: #fff;
    -webkit-tap-highlight-color: transparent;
    transition: transform .15s, box-shadow .15s;
    position: relative;
}
.ca-recent-item:active { transform: scale(.95); }
.ca-recent-item:hover { box-shadow: 0 1px 6px rgba(0,0,0,.1); }
.ca-recent-item .rim {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--green-light) center / cover no-repeat;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    color: #aaa;
}
.ca-recent-item .rim.is-emoji { background-size: 62%; }
.ca-recent-item .rinfo {
    padding: 3px 5px 5px;
    display: flex; flex-direction: column; gap: 1px;
}
.ca-recent-item .rname {
    font-size: 10px; font-weight: 600;
    line-height: 1.2;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4em;
}
.ca-recent-item .rprice {
    font-size: 10px;
    color: var(--green-dark);
    font-weight: 700;
}
.ca-recent-item .rx {
    position: absolute;
    top: 2px; right: 2px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: rgba(255,255,255,.9);
    color: #888;
    border: 0;
    cursor: pointer;
    display: none;
    font-size: 10px;
    line-height: 1;
}
.ca-recent-item:hover .rx { display: block; }
.ca-recent-item .rx .ca-ico { width: 14px; height: 14px; }
.ca-recent-item .rx:active { background: var(--danger); color: #fff; }

/* ─── Sezione categoria ─── */
.ca-cat-section { margin-bottom: 20px; }
.ca-cat-section .ca-cat-title {
    font-size: 16px;
    color: var(--green-dark);
    font-weight: 700;
    margin-bottom: 10px;
    padding: 6px 4px;
    border-bottom: 2px solid var(--green-light);
}

/* ─── Product card (catalog) ─── */
.ca-prod-grid { display: flex; flex-direction: column; gap: 10px; }
.ca-prod-card {
    background: var(--card);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
    padding: 12px;
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: 12px;
    align-items: center;
}
.ca-prod-img {
    width: 72px; height: 72px;
    border-radius: 10px;
    background: #f0f0f0 center / cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #aaa;
    flex-shrink: 0;
}
/* Fallback emoji-categoria (Twemoji): icona centrata con respiro, non foto a pieno riquadro */
.ca-prod-img.is-emoji {
    background-size: 60%;
    background-color: #faf7f1;
}
.ca-prod-info { min-width: 0; }
.ca-prod-name {
    font-size: 15px; font-weight: 600; color: var(--text);
    line-height: 1.3; margin-bottom: 3px;
}
.ca-prod-desc {
    font-size: 12px; color: var(--muted);
    line-height: 1.3; margin-bottom: 4px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ca-prod-meta {
    font-size: 11px; color: #888;
    display: flex; gap: 6px; flex-wrap: wrap;
}
.ca-prod-actions {
    display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
}
.ca-prod-price {
    font-size: 15px; font-weight: 700; color: var(--green-dark);
    white-space: nowrap;
}
.ca-btn-add {
    min-height: 40px; min-width: 50px;
    padding: 8px 14px;
    font-size: 20px;
    font-weight: 700;
}

/* ─── Mini-cart floating (sticky bottom) ─── */
.ca-mini-cart {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--green-dark);
    color: #fff;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    box-shadow: 0 -2px 12px rgba(0,0,0,.15);
    z-index: 20;
}
.ca-mini-cart .text {
    font-size: 13px;
}
.ca-mini-cart .text strong { font-size: 15px; }
.ca-mini-cart .ca-btn {
    background: var(--cta); color: #fff;
    min-height: 34px; padding: 6px 16px;
    font-size: 13px; font-weight: 700;
}
.ca-mini-cart .ca-btn:active { background: var(--cta-dark); }

/* ─── Error / status ─── */
.ca-error-card,
.ca-empty-state {
    background: var(--card);
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    margin: 20px 0;
}
.ca-error-card h1 { color: var(--danger); font-size: 20px; margin-bottom: 10px; }
.ca-error-card p { color: var(--muted); margin-bottom: 14px; }
.ca-empty-state .icon { font-size: 56px; margin-bottom: 12px; }
.ca-empty-state h2 { color: var(--green-dark); font-size: 17px; margin-bottom: 6px; }
.ca-empty-state .muted { color: var(--muted); }

.ca-status {   /* il riquadro (forma, colori, piega) e' di webapp/css/nmp-nota.css */
    margin-top: 10px; font-size: 14px;   /* .ok = fatto, .err = errore, .info = nota */
}

/* ─── Utility ─── */
.muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 14px; }
.mt-3 { margin-top: 22px; }
.mb-2 { margin-bottom: 14px; }
.flex { display: flex; gap: 10px; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }

/* ─── Pagina "Sono al tavolo" (table_scan.php) ─── */
.ca-table-page .ca-section-title {
    font-size: 15px;
    color: var(--green-dark);
    margin-bottom: 6px;
    font-weight: 700;
}
.ca-tbl-viewfinder {
    aspect-ratio: 1 / 1;
    min-height: 220px;
    max-height: 320px;
    margin-bottom: 10px;
}
.ca-tbl-form { display: flex; gap: 8px; align-items: stretch; }
.ca-tbl-form .ca-input-big { margin-top: 0; flex: 1; }
.ca-tbl-form .ca-btn { flex-shrink: 0; }

.ca-tbl-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 10px; flex-wrap: wrap; margin-bottom: 12px;
}
.ca-tbl-num { font-size: 20px; color: var(--green-dark); font-weight: 700; }
.ca-tbl-num strong { font-size: 24px; }
.ca-tbl-meta { font-size: 12px; }

.ca-tbl-session {
    background: var(--green-light);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
}
.ca-tbl-session-h {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 8px;
    color: var(--green-dark);
}
.ca-tbl-session-h .muted { font-size: 12px; }
.ca-tbl-stats {
    display: flex; gap: 14px; margin-bottom: 8px;
    font-size: 13px;
}
.ca-tbl-stats > div { display: flex; flex-direction: column; }
.ca-tbl-stats strong { color: var(--green-dark); font-size: 16px; }

.ca-tbl-preview {
    list-style: none;
    margin: 0; padding: 0;
    font-size: 13px;
    color: #333;
    background: #fff;
    border-radius: 8px;
}
.ca-tbl-preview li {
    display: flex; justify-content: space-between;
    padding: 6px 10px;
    border-bottom: 1px solid #f0f0f0;
}
.ca-tbl-preview li:last-child { border-bottom: 0; }
.ca-tbl-preview li .qty { color: var(--muted); font-weight: 700; }

.ca-tbl-empty {
    background: #f5f5f5;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    margin-bottom: 10px;
}

/* ─── Paginatore catalog ─── */
/* Paginazione in stile marketplace: pillole « Inizio · ← Prec · x/y · Succ → · Fine » */
.ca-pager {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin: 22px 0 6px;
}
.ca-pager a, .ca-pager span {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 15px;
    border-radius: 999px;
    text-decoration: none;
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    transition: background .15s, border-color .15s;
}
.ca-pager a:active { background: var(--green-light); border-color: var(--green); }
.ca-pager span.current { background: var(--green); color: #fff; border-color: var(--green); }
.ca-pager span.disabled { opacity: .35; pointer-events: none; }
@media (max-width: 480px) {
    .ca-pager { gap: 6px; margin: 16px 0 6px; }
    .ca-pager a, .ca-pager span { padding: 8px 12px; font-size: 12px; }
}

/* ─── CTA scan da catalog (in alto, ben visibile) ─── */
.ca-scan-cta {
    margin-bottom: 10px;
    background: var(--cta);
    text-align: center;
    font-size: 15px;
}
.ca-scan-cta:active { background: var(--cta-dark); }

/* ─── Scanner barcode prodotti (scan.php) ─── */
.ca-scan-page { padding-bottom: 90px; }
.ca-scan-status {   /* il riquadro (forma, colori, piega) e' di webapp/css/nmp-nota.css */
    margin-bottom: 12px;
    font-size: 14px;
    text-align: center;
}
.ca-scan-viewfinder {
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    aspect-ratio: 4 / 3;
    min-height: 240px;
    transition: box-shadow .25s;
}
.ca-scan-viewfinder.ok  { box-shadow: 0 0 0 4px var(--green), 0 0 20px rgba(46,125,50,.6); }
.ca-scan-viewfinder.err { box-shadow: 0 0 0 4px var(--danger), 0 0 20px rgba(198,40,40,.5); }
/* id-agnostico: copre TUTTI i lettori (ca-scan-reader, ca-tbl-reader, inv-scan-reader,
   e futuri). Prima era agganciato solo a #ca-scan-reader → su magazzino e tavolo il
   video non riempiva il container e il mirino di html5-qrcode finiva fuori centro. */
.ca-scan-viewfinder [id$="-reader"],
.ca-scan-viewfinder [id$="-reader"] video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    border-radius: 12px;
}
.ca-scan-overlay {
    position: absolute; inset: 0;
    pointer-events: none;
    background:
      linear-gradient(transparent 35%, rgba(46,125,50,.0) 50%, transparent 65%);
}
.ca-scan-overlay::before {
    content: '';
    position: absolute;
    top: 48%; left: 12%; right: 12%;
    height: 2px;
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
    animation: ca-scan-line 1.6s ease-in-out infinite;
}
@keyframes ca-scan-line {
    0%, 100% { transform: translateY(-30px); opacity: .9; }
    50%      { transform: translateY( 30px); opacity: .5; }
}
.ca-scan-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.ca-scan-controls .ca-btn { flex: 1 1 100px; min-height: 42px; font-size: 13px; padding: 10px 8px; }
.ca-scan-feedback {   /* il riquadro (forma, colori, piega) e' di webapp/css/nmp-nota.css */
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    animation: ca-scan-flash .25s;
}
@keyframes ca-scan-flash { from { transform: scale(.96); } to { transform: scale(1); } }
.ca-scan-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.ca-scan-actions .ca-btn { flex: 1 1 140px; }

.ca-input-big {
    width: 100%;
    padding: 14px;
    font-size: 18px;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-top: 8px;
    text-align: center;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}
.ca-input-big:focus { outline: 2px solid var(--green); outline-offset: -2px; }

/* Codice tavolo 4-char: tracking ampio + uppercase enforce CSS-level */
.ca-input-tbl-code {
    text-transform: uppercase;
    letter-spacing: 8px;
    font-size: 26px;
    font-weight: 700;
    padding: 16px 18px;
}
/* CHG-2045 (RIF-9): il segnaposto è una frase («Codice o nome del tavolo»), non un codice: niente tracking da 8px né 26px */
.ca-input-tbl-code::placeholder { text-transform: none; letter-spacing: 0; font-size: 16px; font-weight: 400; }

/* ─── Mobile (max 480px): cinghia + sicurezza touch ─── */
@media (max-width: 480px) {
    .ca-header { padding: 8px 12px; }
    .ca-header .ca-shop-name { font-size: 15px; }
    .ca-main { padding: 12px; padding-bottom: 90px; }
    .ca-prod-card { grid-template-columns: 60px 1fr auto; gap: 10px; padding: 10px; }
    .ca-prod-img { width: 60px; height: 60px; }
    .ca-prod-name { font-size: 14px; }
}

/* =====================================================================
   FIX RESPONSIVE BATCH 2 — iOS zoom, tap targets WCAG, hover guards,
   tablet breakpoint, modal padding piccoli phone.
   ===================================================================== */

/* iOS Safari: forza font-size 16px su tutti gli input/textarea/select per
   prevenire auto-zoom al focus. Override !important perché spesso ci sono
   stili inline o regole più specifiche. */
@media (max-width: 600px) {
    .ca-filters input,
    .ca-filters select,
    input[type="search"],
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="password"],
    select,
    textarea { font-size: 16px !important; }
}

/* Tap targets WCAG 44x44 su elementi cliccabili importanti */
.ca-btn-add,
.ca-modal-close,
.ca-prod-open {
    min-width: 44px;
    min-height: 44px;
    box-sizing: border-box;
}

/* Hover guards: su touch device hover "stuck" su card toccate.
   Wrappare con @media (hover: hover) abilita solo per pointer reali. */
@media (hover: hover) {
    .ca-tile.primary:hover,
    .ca-prod-card:hover { transform: translateY(-1px); }
}

/* Breakpoint tablet 601-1024px: grid prodotti/tiles più stretto */
@media (min-width: 601px) and (max-width: 1024px) {
    .ca-tiles-row { gap: 10px; }   /* le colonne le decide --n (CHG-1395) */
}

/* Phone piccoli (<= 380px): padding modali ridotto per non tagliare contenuto */
@media (max-width: 380px) {
    .ca-modal-content { padding: 18px 14px; }
}

/* Stepper flow su phone <= 360 — testo step nascosto già da media query precedente,
   ma il font del badge step rimaneva 12px ovunque, illeggibile. */
@media (max-width: 480px) {
    .ca-flow-hint .step { font-size: 13px; }
}

/* Modal Info Nutrizionali QRCart (Feature A): grid metrics + score block */
.ca-nutri-metric {
    background: #f6faf2;
    border: 1px solid rgba(72,136,49,.15);
    border-radius: 8px;
    padding: 10px 12px;
}
.ca-nutri-metric > div:first-child { margin-bottom: 4px; }

/* =====================================================================
   Vista LISTA recensioni (qrcart/reviews.php) — mobile-first, tema verde
   ===================================================================== */
.ca-reviews-head { margin: 4px 0 14px; }
.ca-reviews-head h1 {
    font-size: 20px; color: var(--green-dark);
    margin: 0 0 6px; line-height: 1.2;
}
.ca-reviews-summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ca-reviews-summary .ca-review-stars { color: #f0a500; font-size: 18px; letter-spacing: 1px; }
.ca-reviews-summary .ca-reviews-avg { font-weight: 700; color: var(--green-dark); font-size: 17px; }
.ca-reviews-summary .ca-reviews-count { color: var(--muted); font-size: 13px; }

.ca-review-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ca-review-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.ca-review-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ca-review-card .ca-review-stars { color: #f0a500; font-size: 18px; letter-spacing: 1px; line-height: 1; }
.ca-review-date { color: var(--muted); font-size: 12px; white-space: nowrap; }
.ca-review-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.ca-review-author { font-weight: 600; color: var(--green-dark); font-size: 14px; }
.ca-review-channel {
    display: inline-block;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1px 9px;
    font-size: 11px; color: var(--muted);
}
.ca-review-text {
    margin: 8px 0 0; font-size: 14px; line-height: 1.45;
    color: #2b342a; word-break: break-word;
}
.ca-review-aspects {
    margin-top: 10px; padding-top: 10px;
    border-top: 1px dashed var(--border);
    display: flex; flex-direction: column; gap: 4px;
}
.ca-review-aspect { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ca-review-aspect-label { font-size: 12px; color: var(--muted); }
.ca-review-aspect-stars { color: #f0a500; font-size: 13px; letter-spacing: 1px; line-height: 1; }

.ca-reviews-empty { text-align: center; padding: 36px 20px; color: var(--muted); }
.ca-reviews-empty-icon { font-size: 44px; color: #f0a500; line-height: 1; }
.ca-reviews-empty h2 { color: var(--green-dark); font-size: 18px; margin: 12px 0 6px; }
.ca-reviews-empty p { font-size: 14px; margin: 0 auto; max-width: 320px; }

.ca-reviews-pager {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; margin-top: 16px;
}
.ca-reviews-pager .ca-btn { width: auto; }
.ca-reviews-page-num { font-size: 13px; color: var(--muted); }

/* CHG-625 — Nutri-Score nella scheda prodotto (prima stava solo sulla card della lista,
   e apriva il prodotto proprio chi voleva leggerlo con calma). */
.ca-pd-nutri {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
}
.ca-pd-nutri-badge {
    display: inline-block;
    min-width: 26px;
    text-align: center;
    padding: 3px 9px;
    border-radius: 6px;
    font-weight: 900;
    font-size: 14px;
    letter-spacing: .5px;
}
.ca-pd-nutri-label {
    font-size: 11px;
    color: var(--muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: .04em;
}
