/* =================================================================
   DishFlow — ricercalocale.css  v2
   Filtri avanzati · Card partner VIP · Dark premium
   ================================================================= */

: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;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body { font-family: system-ui,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: system-ui,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;
}
.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: system-ui,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: system-ui,sans-serif; font-size: .76rem; font-weight: 700;
    flex-shrink: 0; transition: background var(--t);
}
.search-go:hover { background: var(--goldh); }

/* 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 cucina */
.fpill {
    background: rgba(255,255,255,.04); border: 1px solid var(--brd2);
    border-radius: 50px; padding: 4px 13px;
    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); }

/* Bottone filtri avanzati */
.filter-advanced-btn {
    display: flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,.05); border: 1px solid var(--brd2);
    border-radius: 50px; padding: 4px 14px;
    font-size: .72rem; font-weight: 700; color: var(--gray);
    white-space: nowrap; flex-shrink: 0; transition: all var(--t);
}
.filter-advanced-btn:hover { border-color: rgba(201,168,76,.4); color: var(--gold); }
.filter-advanced-btn.active { background: rgba(201,168,76,.12); border-color: var(--gold); color: var(--gold); }
.filter-count {
    background: var(--gold); color: #07090f;
    border-radius: 50%; width: 16px; height: 16px;
    font-size: .60rem; font-weight: 900;
    display: flex; align-items: center; justify-content: center;
}

/* 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: system-ui,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); }

/* ── PANNELLO FILTRI AVANZATI ────────────────────────────────── */
.filter-panel-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.55); z-index: 98;
    backdrop-filter: blur(3px);
}
.filter-panel-overlay.show { display: block; }

.filter-panel {
    position: fixed; top: var(--TH); right: -380px; width: 360px;
    height: calc(100vh - var(--TH));
    background: var(--bg2); border-left: 1px solid var(--border);
    z-index: 99; transition: right .3s cubic-bezier(.16,1,.3,1);
    display: flex; flex-direction: column; overflow: hidden;
}
.filter-panel.open { right: 0; }

.fp-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px; border-bottom: 1px solid var(--brd2); flex-shrink: 0;
}
.fp-head h3 { font-family: Georgia,serif; font-size: 1.1rem; font-weight: 600; }
.fp-close {
    width: 30px; height: 30px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--gray); font-size: .9rem;
    transition: all var(--t);
}
.fp-close:hover { background: rgba(255,255,255,.07); color: var(--white); }

.fp-body { flex: 1; overflow-y: auto; padding: 20px; scrollbar-width: thin; }

.fp-section { margin-bottom: 24px; }
.fp-section h4 {
    font-size: .65rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: 1.5px; color: var(--gray2); margin-bottom: 12px;
}
.fp-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.fchip {
    padding: 7px 14px; border-radius: 50px;
    background: rgba(255,255,255,.04); border: 1px solid var(--brd2);
    font-size: .78rem; font-weight: 600; color: rgba(255,255,255,.6);
    transition: all var(--t);
}
.fchip:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: var(--white); }
.fchip.active { background: rgba(201,168,76,.12); border-color: rgba(201,168,76,.5); color: var(--gold); }
.fchip.partner-chip { background: rgba(201,168,76,.06); border-color: rgba(201,168,76,.25); color: var(--gold); }
.fchip.partner-chip.active { background: rgba(201,168,76,.20); border-color: var(--gold); }

.fp-footer {
    display: flex; gap: 10px; padding: 16px 20px;
    border-top: 1px solid var(--brd2); flex-shrink: 0;
}
.fp-reset {
    flex: 1; padding: 11px; border-radius: 10px;
    border: 1px solid var(--brd2); color: var(--gray);
    font-size: .84rem; font-weight: 600; transition: all var(--t);
}
.fp-reset:hover { border-color: rgba(255,255,255,.2); color: var(--white); }
.fp-apply {
    flex: 2; padding: 11px; border-radius: 10px;
    background: linear-gradient(135deg, #e8c96a, #b8900a);
    color: #07090f; font-size: .88rem; font-weight: 800;
    transition: all var(--t);
    box-shadow: 0 4px 16px rgba(201,168,76,.25);
}
.fp-apply:hover { transform: translateY(-1px); box-shadow: 0 7px 22px rgba(201,168,76,.38); }

/* ── 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 ──────────────────────────────────────────────────── */
.app-layout { position: fixed; top: var(--TH); left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 440px 1fr; }

/* ── LISTA ───────────────────────────────────────────────────── */
.list-panel { background: var(--bg); border-right: 1px solid var(--brd2); display: flex; flex-direction: column; overflow: hidden; 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-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: 10px; padding: 40px 20px; text-align: center; }
.empty-icon { font-size: 2.5rem; margin-bottom: 4px; }
.empty-title { font-size: .95rem; font-weight: 700; }
.empty-sub   { font-size: .78rem; color: var(--gray); }
.empty-reset { margin-top: 8px; padding: 9px 22px; border-radius: 50px; border: 1px solid var(--border); color: var(--gold); font-size: .78rem; font-weight: 700; transition: all var(--t); }
.empty-reset:hover { background: rgba(201,168,76,.08); }

/* Lista scrollabile */
.rest-list { flex: 1; overflow-y: auto; 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; }

/* 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-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; }

/* ── CARD ────────────────────────────────────────────────────── */
.rest-card {
    display: flex; flex-direction: column;
    background: var(--card); border: 1px solid var(--brd2);
    border-radius: var(--r); overflow: hidden; cursor: pointer;
    flex-shrink: 0; text-decoration: none; color: inherit;
    transition: border-color var(--t), transform var(--t), box-shadow var(--t);
    animation: fadeUp .28s ease both;
    position: relative;
}
@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); }

/* ── CARD PARTNER DISHFLOW — bordo e glow dorato ─────────────── */
.rest-card.dishflow-partner {
    border-color: rgba(201,168,76,.35);
    background: linear-gradient(160deg, rgba(201,168,76,.05) 0%, var(--card) 35%);
    box-shadow: 0 0 0 1px rgba(201,168,76,.12), 0 4px 20px rgba(201,168,76,.08);
}
.rest-card.dishflow-partner:hover {
    border-color: var(--gold);
    box-shadow: 0 0 0 1px rgba(201,168,76,.3), 0 10px 32px rgba(201,168,76,.18);
}

/* ── CARD RISTORANTE NON PAGANTE — in fondo, opacità ridotta ─── */
.rest-card.non-partner-low {
    opacity: .65;
    filter: saturate(.7);
}
.rest-card.non-partner-low:hover { opacity: .85; filter: saturate(.9); }

/* Foto */
.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 stato */
.rest-status-badge { position: absolute; top: 10px; left: 10px; padding: 3px 10px; border-radius: 50px; 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-size: .70rem; font-weight: 800; color: var(--gold); }

/* Badge DishFlow Partner — SEMPRE VISIBILE, sopra la foto */
.rest-partner-badge {
    position: absolute; bottom: 10px; left: 10px;
    background: linear-gradient(135deg, #e8c96a, #c9a84c);
    color: #07090f;
    border-radius: 50px; padding: 5px 12px;
    font-size: .64rem; font-weight: 900;
    display: flex; align-items: center; gap: 5px;
    letter-spacing: .3px;
    box-shadow: 0 3px 12px rgba(201,168,76,.5);
    z-index: 2;
    text-transform: uppercase;
}
.rest-partner-badge svg { flex-shrink: 0; }

/* 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-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-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); }
.rest-tag.partner { background: rgba(201,168,76,.10); border-color: rgba(201,168,76,.35); color: var(--gold); font-weight: 700; }
.rest-tag.green   { background: rgba(34,197,94,.08); border-color: rgba(34,197,94,.25); color: var(--green); }

/* Footer card */
.rest-footer { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px 12px; border-top: 1px solid var(--brd2); }
.rest-footer-left { font-size: .68rem; color: var(--gray2); }
.prenota-btn { background: var(--gold); color: #0d1117; border: none; border-radius: 50px; padding: 7px 18px; 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); }
/* Bottone partner ha sfondo pieno gold */
.rest-card.dishflow-partner .prenota-btn { box-shadow: 0 4px 14px rgba(201,168,76,.3); }

/* ── CONTROLLI MAPPA GOLD ────────────────────────────────────── */
.gm-bundled-control .gmnoprint,
.gmnoprint button,
.gm-control-active,
.gm-fullscreen-control {
    background: rgba(13,17,23,.95) !important;
    border: 1px solid rgba(201,168,76,.35) !important;
    color: var(--gold) !important;
    border-radius: 8px !important;
}
.gm-control-active img { filter: invert(1) sepia(1) saturate(3) hue-rotate(5deg) brightness(1.2) !important; }
.gm-control-active:hover {
    background: rgba(201,168,76,.15) !important;
    border-color: var(--gold) !important;
}
/* Zoom buttons */
.gm-bundled-control-on-bottom { filter: drop-shadow(0 4px 12px rgba(201,168,76,.2)); }

/* ── DROPDOWN AUTOCOMPLETE ───────────────────────────────────── */
.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; }
.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; }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 960px) {
    .app-layout { grid-template-columns: 1fr; }
    .map-panel  { display: none; }
    .list-panel { border-right: none; }
    .filter-panel { width: 100%; right: -100%; }
}
@media (max-width: 600px) {
    .topbar { padding: 0 12px; gap: 10px; }
    :root   { --TH: 116px; }
}

/* ── MAPPA ───────────────────────────────────────────────────── */
.map-panel { position: relative; }
#googleMap { width: 100%; height: 100%; background: var(--bg3); }

/* ── CONTROLLI MAPPA GOLD ────────────────────────────────────── */
.gm-bundled-control .gmnoprint,
.gmnoprint button,
.gm-control-active,
.gm-fullscreen-control {
    background: rgba(13,17,23,.95) !important;
    border: 1px solid rgba(201,168,76,.35) !important;
    border-radius: 8px !important;
}
.gm-control-active img { filter: invert(1) sepia(1) saturate(3) hue-rotate(5deg) brightness(1.2) !important; }
.gm-control-active:hover { background: rgba(201,168,76,.15) !important; border-color: #c9a84c !important; }
.gm-bundled-control-on-bottom { filter: drop-shadow(0 4px 12px rgba(201,168,76,.2)); }