/* =================================================================
   DishFlow — ricercalocale.css  (versione completa e definitiva)
   ================================================================= */

:root {
    --bg:      #0d1117;
    --bg2:     #111827;
    --bg3:     #1a2235;
    --card:    #141c2e;
    --gold:    #c9a84c;
    --goldh:   #e8c96a;
    --white:   #ffffff;
    --gray:    #8892a4;
    --gray2:   #4a5568;
    --green:   #22c55e;
    --red:     #ef4444;
    --border:  rgba(201,168,76,.18);
    --brd2:    rgba(255,255,255,.07);
    --r:       12px;
    --t:       .2s ease;
    --TH:      110px;   /* altezza topbar */
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--white); }
.gold { color: var(--gold); }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }

/* ── TOPBAR ──────────────────────────────────────────────────── */
.topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 50;
    height: var(--TH);
    background: rgba(13,17,23,.97);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    padding: 0 20px;
    gap: 18px;
}

.logo { display: flex; align-items: center; padding-top: 16px; }
.logo-img { height: 34px; width: auto; object-fit: contain; }
.logo-text { font-family: 'Montserrat',sans-serif; font-weight: 800; font-size: 1.3rem; color: var(--white); }

.topbar-center { display: flex; flex-direction: column; padding-top: 13px; min-width: 0; }

/* Barra ricerca */
.topbar-search {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(201,168,76,.28);
    border-radius: 50px; padding: 5px 5px 5px 14px;
    height: 40px; transition: border-color var(--t);
    position: relative;   /* necessario per dropdown suggestions */
}
.topbar-search:focus-within { border-color: var(--gold); }

.search-icon {
    width: 16px; height: 16px;
    color: var(--gray); flex-shrink: 0; stroke: currentColor;
}
.city-input {
    flex: 1; background: none; border: none; outline: none;
    color: var(--white); font-size: .9rem;
    font-family: 'Inter',sans-serif; min-width: 0;
}
.city-input::placeholder { color: var(--gray); }

.search-go {
    background: var(--gold); border: none; border-radius: 50px;
    padding: 6px 20px; color: #0d1117;
    font-family: 'Montserrat',sans-serif; font-size: .76rem; font-weight: 700;
    flex-shrink: 0; transition: background var(--t);
}
.search-go:hover { background: var(--goldh); }

/* ── DROPDOWN SUGGERIMENTI (ricercalocale) ───────────────────── */
.df-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0; right: 0;
    background: var(--bg2);
    border: 1px solid rgba(201,168,76,.30);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.75);
    overflow: hidden;
    z-index: 99999;
    padding: 4px 0;
}
.df-sug-item {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 18px; cursor: pointer;
    border-top: 1px solid rgba(255,255,255,.05);
    transition: background .15s;
}
.df-sug-item:first-child { border-top: none; }
.df-sug-item:hover { background: rgba(201,168,76,.09); }
.df-sug-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); flex-shrink: 0; opacity: .8; }
.df-sug-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.df-sug-main { font-size: .90rem; color: var(--white); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: 'Montserrat',sans-serif; }
.df-sug-main strong { color: var(--gold); font-weight: 800; }
.df-sug-sub  { font-size: .74rem; color: var(--gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── FILTRI ROW ──────────────────────────────────────────────── */
.filters-row {
    display: flex; align-items: center; gap: 5px;
    padding: 8px 0 0; overflow-x: auto; scrollbar-width: none;
}
.filters-row::-webkit-scrollbar { display: none; }

.fgroup { display: flex; gap: 4px; flex-shrink: 0; }

.fsep {
    width: 1px; height: 18px; background: var(--brd2);
    flex-shrink: 0; margin: 0 3px; align-self: center;
}

/* Pill categoria */
.fpill {
    background: rgba(255,255,255,.04);
    border: 1px solid var(--brd2);
    border-radius: 50px; padding: 4px 13px;
    font-family: 'Montserrat',sans-serif;
    font-size: .70rem; font-weight: 600;
    color: var(--gray); white-space: nowrap;
    transition: all var(--t);
}
.fpill:hover  { background: rgba(201,168,76,.10); border-color: rgba(201,168,76,.40); color: var(--goldh); }
.fpill.active { background: rgba(201,168,76,.15); border-color: var(--gold); color: var(--gold); }

/* Toggle speciali */
.ftoggle {
    background: rgba(255,255,255,.04);
    border: 1px solid var(--brd2);
    border-radius: 50px; padding: 4px 13px;
    font-family: 'Montserrat',sans-serif;
    font-size: .70rem; font-weight: 600;
    color: var(--gray); white-space: nowrap;
    transition: all var(--t);
}
.ftoggle:hover  { border-color: rgba(255,255,255,.18); color: var(--white); }
.ftoggle.active { background: rgba(34,197,94,.12); border-color: var(--green); color: var(--green); }

/* Prezzo */
.fprice {
    background: rgba(255,255,255,.04);
    border: 1px solid var(--brd2);
    border-radius: 8px; padding: 4px 9px;
    font-family: 'Montserrat',sans-serif;
    font-size: .70rem; font-weight: 700;
    color: var(--gray); white-space: nowrap;
    transition: all var(--t);
}
.fprice:hover  { background: rgba(201,168,76,.10); border-color: rgba(201,168,76,.40); color: var(--goldh); }
.fprice.active { background: rgba(201,168,76,.15); border-color: var(--gold); color: var(--gold); }

/* Select ordina */
.fsort {
    background: rgba(255,255,255,.04);
    border: 1px solid var(--brd2);
    border-radius: 50px; padding: 4px 12px;
    color: var(--gray); font-size: .70rem;
    font-family: 'Montserrat',sans-serif;
    font-weight: 600; outline: none;
    flex-shrink: 0; cursor: pointer;
    appearance: none; -webkit-appearance: none;
    transition: all var(--t);
}
.fsort:hover  { border-color: rgba(255,255,255,.18); color: var(--white); }
.fsort option { background: var(--bg2); color: var(--white); }

/* ── BURGER ──────────────────────────────────────────────────── */
.burger-btn {
    background: none; border: none; padding: 6px; padding-top: 20px;
    display: flex; flex-direction: column; gap: 5px; align-self: start;
}
.burger-btn span {
    display: block; width: 22px; height: 2px;
    background: var(--white); border-radius: 2px;
    transition: background var(--t);
}
.burger-btn:hover span { background: var(--gold); }

/* ── SIDEBAR ─────────────────────────────────────────────────── */
.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.6); z-index: 90;
}
.sidebar-overlay.show { display: block; }

.sidebar-right {
    position: fixed; top: 0; right: -310px; width: 285px; height: 100vh;
    background: var(--bg2); border-left: 1px solid var(--border);
    z-index: 100; transition: right .3s ease;
    display: flex; flex-direction: column; overflow-y: auto;
}
.sidebar-right.open { right: 0; }

.sidebar-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.sidebar-logo { height: 28px; width: auto; object-fit: contain; }
.sidebar-close { background: none; border: none; color: var(--gray); font-size: 1.1rem; line-height: 1; }
.sidebar-close:hover { color: var(--white); }

.sidebar-nav { padding: 14px 14px 28px; display: flex; flex-direction: column; gap: 1px; }
.s-lbl {
    font-size: .65rem; font-weight: 700; letter-spacing: 1.2px;
    text-transform: uppercase; color: var(--gray2); padding: 10px 8px 4px;
}
.s-link {
    display: flex; align-items: center;
    padding: 10px; border-radius: var(--r);
    color: var(--white); font-size: .88rem; font-weight: 500;
    transition: background var(--t);
}
.s-link:hover { background: rgba(255,255,255,.05); }
.gold-link { color: var(--gold); font-weight: 700; }
.gold-link:hover { background: rgba(201,168,76,.10); }
.s-div { height: 1px; background: var(--border); margin: 6px 0; }

/* ── LAYOUT PRINCIPALE ───────────────────────────────────────── */
.app-layout {
    position: fixed;
    top: var(--TH); left: 0; right: 0; bottom: 0;
    display: grid;
    grid-template-columns: 440px 1fr;
}

/* ── PANNELLO LISTA ──────────────────────────────────────────── */
.list-panel {
    background: var(--bg);
    border-right: 1px solid var(--brd2);
    display: flex; flex-direction: column;
    overflow: hidden;               /* il pannello è fisso */
    height: 100%;
}

.list-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; border-bottom: 1px solid var(--brd2); flex-shrink: 0;
}
.list-title { font-family: 'Montserrat',sans-serif; font-size: .92rem; font-weight: 700; }
.list-count  { font-size: .72rem; color: var(--gray); }

/* Badge filtri attivi */
.active-filters {
    display: flex; gap: 5px; flex-wrap: wrap;
    padding: 8px 12px 0; flex-shrink: 0; min-height: 0;
}
.af-badge {
    display: flex; align-items: center; gap: 5px;
    background: rgba(201,168,76,.08); border: 1px solid var(--border);
    border-radius: 50px; padding: 3px 10px;
    font-size: .68rem; color: var(--gold); font-weight: 600;
}
.af-badge button { color: var(--gold); font-size: .75rem; padding: 0; line-height: 1; }

/* Loading */
.loading-wrap {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 14px;
    color: var(--gray); font-size: .88rem;
}
.spinner {
    width: 36px; height: 36px; border-radius: 50%;
    border: 3px solid var(--brd2); border-top-color: var(--gold);
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty */
.empty-wrap {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 8px; padding: 40px 20px; text-align: center;
}
.empty-title { font-family: 'Montserrat',sans-serif; font-size: .95rem; font-weight: 700; }
.empty-sub   { font-size: .78rem; color: var(--gray); }

/* ─────────────────────────────────────────────────────────────
   LISTA RISTORANTI — scrollabile, card complete
   ───────────────────────────────────────────────────────────── */
.rest-list {
    flex: 1;
    overflow-y: auto;           /* scroll verticale */
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--bg3) transparent;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.rest-list::-webkit-scrollbar { width: 5px; }
.rest-list::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 4px; }

/* ── CARD ────────────────────────────────────────────────────── */
.rest-card {
    display: flex;
    flex-direction: column;         /* verticale — foto sopra, testo sotto */
    background: var(--card);
    border: 1px solid var(--brd2);
    border-radius: var(--r);
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;                 /* impedisce che la card venga compressa */
    text-decoration: none;
    color: inherit;
    transition: border-color var(--t), transform var(--t), box-shadow var(--t);
    animation: fadeUp .28s ease both;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.rest-card:hover {
    border-color: rgba(201,168,76,.40);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0,0,0,.45);
}
.rest-card.active {
    border-color: var(--gold);
    box-shadow: 0 0 0 1px var(--gold), 0 6px 24px rgba(201,168,76,.14);
}

/* Foto — altezza fissa, non tagliata */
.rest-img-wrap {
    position: relative;
    width: 100%;
    height: 170px;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--bg3);
}
.rest-img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
    display: block;
}
.rest-card:hover .rest-img { transform: scale(1.04); }

/* Badge sulla foto */
.rest-status-badge {
    position: absolute; top: 10px; left: 10px;
    padding: 3px 10px; border-radius: 50px;
    font-family: 'Montserrat',sans-serif;
    font-size: .64rem; font-weight: 700;
    backdrop-filter: blur(6px);
}
.rest-status-badge.open   { background: rgba(34,197,94,.20); border: 1px solid var(--green); color: var(--green); }
.rest-status-badge.closed { background: rgba(239,68,68,.16); border: 1px solid var(--red);   color: var(--red); }

.rest-price-badge {
    position: absolute; top: 10px; right: 10px;
    background: rgba(13,17,23,.80);
    border: 1px solid var(--border);
    backdrop-filter: blur(6px);
    padding: 3px 9px; border-radius: 50px;
    font-family: 'Montserrat',sans-serif;
    font-size: .70rem; font-weight: 800; color: var(--gold);
}

/* Corpo card */
.rest-body { padding: 12px 14px 10px; display: flex; flex-direction: column; gap: 5px; }

.rest-type {
    font-size: .66rem; color: var(--gold);
    font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
}
.rest-name {
    font-family: 'Montserrat',sans-serif;
    font-size: .98rem; font-weight: 800; line-height: 1.2;
}

.rest-rating-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rest-stars       { color: var(--gold); font-size: .80rem; letter-spacing: 1px; line-height: 1; }
.rest-rating-num  { font-family: 'Montserrat',sans-serif; font-size: .78rem; font-weight: 700; }
.rest-reviews     { font-size: .70rem; color: var(--gray); }

.rest-address { font-size: .73rem; color: var(--gray); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rest-dist    { font-size: .70rem; color: var(--gray2); }

.rest-tags    { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.rest-tag {
    font-size: .62rem; padding: 2px 8px;
    border-radius: 50px; border: 1px solid var(--brd2);
    color: var(--gray); font-weight: 500;
}
.rest-tag.gold { border-color: rgba(201,168,76,.3); color: var(--gold); }

/* Footer card */
.rest-footer {
    display: flex; align-items: center; justify-content: flex-end;
    padding: 8px 14px 12px;
    border-top: 1px solid var(--brd2);
}
.prenota-btn {
    background: var(--gold); color: #0d1117;
    border: none; border-radius: 50px;
    padding: 7px 18px;
    font-family: 'Montserrat',sans-serif;
    font-size: .74rem; font-weight: 800;
    transition: background var(--t), transform var(--t);
    white-space: nowrap;
}
.prenota-btn:hover { background: var(--goldh); transform: scale(1.03); }

/* ── LOAD MORE ───────────────────────────────────────────────── */
.load-more-wrap { padding: 10px 12px; border-top: 1px solid var(--brd2); flex-shrink: 0; }
.load-more-btn {
    width: 100%; background: transparent;
    border: 1px solid var(--border); border-radius: 50px; padding: 11px;
    font-family: 'Montserrat',sans-serif; font-size: .78rem; font-weight: 700;
    color: var(--gold); transition: all var(--t);
}
.load-more-btn:hover     { background: rgba(201,168,76,.10); }
.load-more-btn:disabled  { opacity: .4; cursor: not-allowed; }

/* ── MAPPA ───────────────────────────────────────────────────── */
.map-panel { position: relative; }
#googleMap { width: 100%; height: 100%; background: var(--bg3); }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 960px) {
    .app-layout { grid-template-columns: 1fr; }
    .map-panel  { display: none; }
    .list-panel { border-right: none; }
}
@media (max-width: 600px) {
    .topbar { padding: 0 12px; gap: 10px; }
    :root   { --TH: 116px; }
    .app-layout { grid-template-columns: 1fr; }
}