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

:root{
    --bg:#eae8dc;
    --card:rgba(255,255,255,0.08);
    --text:#ffffff;
    --text-soft:#94a3b8;
    --accent:#3b82f6;
    --border:rgba(255,255,255,0.08);
}

body{
    font-family:'Inter',sans-serif;
    min-height:100vh;
    /*
        background:
            radial-gradient(circle at top left, #1e293b 0%, transparent 35%),
            radial-gradient(circle at bottom right, #0f172a 0%, transparent 30%),
            linear-gradient(180deg,#0f172a 0%,#111827 100%);

    background:
        radial-gradient(circle at top left, #60a5fa 0%, transparent 35%),
        radial-gradient(circle at bottom right, #38bdf8 0%, transparent 30%),
        linear-gradient(180deg, #1e293b 0%, #334155 100%);
    */
    background:

    radial-gradient(circle at top left, #64748b 0%, transparent 40%),
    radial-gradient(circle at bottom right, #64748b 0%, transparent 30%),
   

    linear-gradient(180deg, #334155 0%, #475569 100%);
    color:var(--text);
    padding:0 20px;

}


/* =========================
TOPBAR (DA RISULTATI)
========================= */

/* 

.topbar{
    position:sticky;
    top:0;
    z-index:9;
    padding:16px;
    backdrop-filter:blur(22px);
    background:rgba(15,23,42,0.75);
    border-bottom:1px solid rgba(255,255,255,0.05);
} 
*/

.topbar{
    position:sticky;
    top:0;
    z-index:9;
    padding:16px;
    backdrop-filter:blur(22px);
    
    background:rgba(15,23,42,0.05);
    border-bottom:1px solid rgba(255,255,255,0.05);
    border-radius: 0 0 24px 24px;
    
    
}


.search-wrapper{
    width:100%;
    max-width:1200px;
    margin:auto;
}

.search-box{
    width:100%;
    display:flex;
    align-items:center;
    overflow:hidden;
    border-radius:24px;
    background:rgba(255,255,255,0.08);
    border:1px solid rgba(255,255,255,0.06);
    backdrop-filter:blur(18px);
    box-shadow:
        0 10px 30px rgba(0,0,0,0.25),
        inset 0 1px 0 rgba(255,255,255,0.06);
}

.country{
    height:64px;
    border:none;
    outline:none;
    background:rgba(255,255,255,0.06);
    color:white;
    padding:0 18px;
    font-size:15px;
    font-weight:600;
    border-right:1px solid rgba(255,255,255,0.05);
    cursor:pointer;
}

.country option{
    background:#111827;
}

.search-input{
    width:100%;
    height:64px;
    border:none;
    outline:none;
    background:transparent;
    color:white;
    padding:0 18px;
    font-size:16px;
}

.search-input::placeholder{
    color:rgba(255,255,255,0.45);
}

.search-btn{
    

    width:72px;
    height:64px;
    padding: 0 5px;
    border:none;
    cursor:pointer;
    /* colore sfondo */
    background-color:#2563eb;

    /* immagine sopra */
}
.search-btn img{
    width: auto;
    max-width: 40px
}
/*
.map-btn{
    width:72px;
    height:64px;
    border:none;
    background:linear-gradient(180deg,#10b981,#059669);
    color:white;
    font-size:20px;
    cursor:pointer;
}

.map-btn{
        background-size:cover;
    background-position:center;
    background-image:url('mappa.png');
}

*/
.map-btn{
    width:72px;
    height:64px;
    padding: 0 5px;
    border:none;
    cursor:pointer;
    /* colore sfondo 
    background-color:#111827;*/
    background:rgba(255,255,255,0.06);

    /* immagine sopra */
    /* 111827
    background:
        url('mappa.png') center/70% no-repeat,
        linear-gradient(180deg,#10b981,#059669);
        */
}
.map-btn img{
    width: auto;
    max-width: 40px
}

/* =========================
NAV STACK (QUESTO È IL TUO ID)
========================= */

#navStack{
    flex-direction:column;
    gap:12px;
    max-height:300px;
    overflow:hidden;
    transition:all .35s ease;
    margin-top: 10px;
}

/* COLLAPSE */
#navStack.collapsed{
    max-height:0;
    opacity:0;
    transform:translateY(-6px);
}

/* MACRO */

.macro-scroll{
    display:flex;
    gap:12px;
    overflow-x:auto;
}

.macro-btn{
    padding:12px 18px;
    border-radius:18px;
    background:rgba(255,255,255,0.08);
    border:1px solid rgba(255,255,255,0.06);
    color:white;
    font-weight:600;
    white-space:nowrap;
}


.macro-btn.active{
    background:linear-gradient(180deg,#3b82f6,#2563eb);
}

.filter-chip.active{
    background:linear-gradient(180deg,#3b82f6,#2563eb);
}
/* FILTER */

.filter-scroll{
    display:flex;
    gap:10px;
    overflow-x:auto;
}

.filter-chip{
    flex-shrink:0;
    white-space:nowrap;
    padding:10px 14px;
    border-radius:999px;
    background:rgba(255,255,255,0.07);
    border:1px solid rgba(255,255,255,0.05);
    font-size:14px;
}

/* TOGGLE BUTTON (FRECCIA) */

.toggle-btn{
    position:absolute;
    right:-5px;
    bottom:0px;
    width:35px;
    height:35px;
    font-size: 1.5rem;
    border-radius:12px;
    border:none;
    cursor:pointer;
     /*    background:rgba(255,255,255,0.08);
    color:white;
    backdrop-filter:blur(16px);

 MODIFICA RICHIESTA */
    background:rgba(17,24,39,0.95);
    color:white;

    backdrop-filter:blur(16px);
}

/* =========================
RESTO INVARIATO TUO INDEX
========================= */

.main-wrapper{
    width:100%;
    display:flex;
    justify-content:center;
    align-items:center;
    margin-top:30px;
}

.hero-box{
    width:100%;
    max-width:1100px;
    background: linear-gradient(
        145deg,
        rgba(255,255,255,0.16),
        rgba(255,255,255,0.05)
    );
    backdrop-filter:blur(20px);
    border:1px solid var(--border);
    border-radius:32px;
    padding:40px;
    box-shadow:0 15px 40px rgba(0,0,0,0.25);
}

/* GRID CATEGORIE */

.category-grid{
    width:100%;
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:20px;
}

.category-card{
    position:relative;
    overflow:hidden;
    min-height:260px;
    border-radius:28px;
    text-decoration:none;
    color:white;
    padding:30px;
    display:flex;
    align-items:flex-end;
    transition:all .25s ease;
    box-shadow:0 10px 35px rgba(0,0,0,0.28);
    background-size:cover;
    background-position:center;
}

.category-card:hover{
    transform:translateY(-4px) scale(1.01);
}

.category-content{
    position:relative;
    z-index:2;
}


.category-icon{
    font-size:42px;
    margin-bottom:15px;

    text-shadow:
        0 2px 0 rgba(0,0,0,.9),
        0 0 25px rgba(0,200,255,.6),
        0 0 45px rgba(0,200,255,.25);
    transition: transform .3s ease, text-shadow .3s ease;
}



.category-title{
    font-size:30px;
    font-weight:800;
    margin-bottom:10px;

    color:#fff;

    text-shadow:
        0 2px 6px rgba(0,0,0,.6),
        0 8px 20px rgba(0,0,0,.45);

    letter-spacing:-0.6px;
}

.category-desc{
    font-size:15px;
    line-height:1.6;

    color:rgba(255,255,255,0.92);

    text-shadow:0 2px 10px rgba(0,0,0,.7);
}

.category-card::after{
    content:"";
    position:absolute;
    inset:0;

    background: radial-gradient(
        circle at bottom,
        rgba(0,0,0,.25),
        transparent 65%
    );

    pointer-events:none;
}
.category-card:nth-child(1){
    background-image:url('mangia.webp');
}

.category-card:nth-child(2){
    background-image:url('bevi.webp');
}


.category-card:nth-child(3){
    background-image:url('espe.webp');
}

.category-card:nth-child(4){
    background-image:url('dormi.webp');
}
/* STATS */

.stats-row{
    display:flex;
    justify-content:center;
    gap:15px;
    flex-wrap:wrap;
    margin-top:35px;
}

.stat-item{
    background:rgba(255,255,255,0.08);
    border:1px solid rgba(255,255,255,0.06);
    padding:12px 18px;
    border-radius:999px;
    font-size:14px;
    color:white;
    backdrop-filter:blur(15px);
}

.hidden{
    display: none;
}

/* ===== SUGGERIMENTI ===== */
#suggestionBox { 
  position:absolute; 
  background:white; 
  border:1px solid #ddd; 
  border-radius:8px; 
  max-height:200px; 
  overflow-y:auto;
  color: black; 
  z-index:9999; 
  display:none; 
}

/* MOBILE */

@media(max-width:980px){
    .category-grid{grid-template-columns:1fr;}
}

@media(max-width:600px){
    body{padding:15px;}
    .hero-box{padding:25px;}
}

/* =========================================
320px DEVICES
========================================= */

@media (max-width:400px){

    body{
        padding:6px;
    }

    .topbar{
        padding:6px;
    }

    .search-wrapper{
        width:100%;
        min-width:0;
    }

    .search-box{

        width:100%;

        display:flex;
        align-items:center;
        flex-wrap:nowrap;

        min-width:0;

        overflow:hidden;

        height:50px;

        border-radius:16px;
    }

    /* COUNTRY */

    .country{

        width:42px;
        min-width:42px;

        height:50px;

        padding:0;


        text-align:center;

        font-size:11px;

        border-right:none;

        appearance:none;
        -webkit-appearance:none;
        -moz-appearance:none;
    }

    /* INPUT */

    .search-input{

        flex:1;

        min-width:0;

        width:auto;

        height:50px;

        padding:0 8px;

        font-size:13px;
    }

    .search-input::placeholder{
        font-size:12px;
    }

    /* BUTTONS */

    .search-btn,
    .map-btn{

        width:42px;
        min-width:42px;

        height:50px;

        font-size:15px;

        flex-shrink:0;
    }

    /* STACK */

    #navStack{
        width:100%;
        min-width:0;
        overflow:hidden;

        margin-top:8px;
    }

    /* SCROLL ORIZZONTALE */

    .macro-scroll,
    .filter-scroll{

        display:flex;

        flex-wrap:nowrap;

        overflow-x:auto;

        gap:6px;

        padding-bottom:4px;

        scrollbar-width:none;
    }

    .macro-scroll::-webkit-scrollbar,
    .filter-scroll::-webkit-scrollbar{
        display:none;
    }

    /* BOTTONI */

    .macro-btn,
    .filter-chip{


        padding:8px 12px;

        border-radius:14px;

        font-size:12px;
    }

}



/* PRIVACY */
#privacy {
  display: none; /* inizialmente nascosto */
  padding: 20px 30px;
  background: #ffffff;
  border: 2px solid #007BFF;
  border-radius: 12px;
  max-width: 800px;
  margin: 30px auto;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  max-height: 500px;
  overflow-y: auto;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333333;
  position: relative;
  transition: all 0.3s ease;
}

/* Titoli e sottotitoli */
#privacy h2 {
  color: #007BFF;
  font-size: 1.8em;
  margin-bottom: 15px;
}
#privacy h3 {
  color: #0056b3;
  margin-top: 20px;
  margin-bottom: 8px;
  font-size: 1.2em;
}

/* Liste puntate */
#privacy ul {
  margin-left: 20px;
  margin-bottom: 15px;
}
#privacy li {
  margin-bottom: 8px;
}

/* Bottone chiudi */
#close-privacy {
  display: inline-block;
  margin-top: 20px;
  padding: 10px 18px;
  background-color: #007BFF;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.3s ease;
}
#close-privacy:hover {
  background-color: #0056b3;
}

/* Bottone apri */
#open-privacy {
  padding: 10px 20px;
  background-color: #28a745;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  margin-right: 10px;
}
#open-privacy:hover {
  background-color: #218838;
  transform: scale(1.05);
}

/* Scrollbar personalizzata per Webkit */
#privacy::-webkit-scrollbar {
  width: 8px;
}
#privacy::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}
#privacy::-webkit-scrollbar-thumb {
  background: #007BFF;
  border-radius: 10px;
}
#privacy::-webkit-scrollbar-thumb:hover {
  background: #0056b3;
}

/* ===== MAPPA OVERLAY ===== */
#mapOverlay { position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.7); display:flex; align-items:center; justify-content:center; z-index:10; }
#mapOverlay.hidden { display:none; }
.map-container { background:white; padding:20px; border-radius:16px; width:90%; max-width:900px; text-align:center; position:relative; }
#leafletMap { width:100%; height:500px; border-radius:12px; }
#closeMap { position:absolute; top:10px; right:10px; background:red; color:white; border:none; border-radius:50%; width:36px; height:36px; font-size:20px; font-weight:bold; cursor:pointer; display:flex; align-items:center; justify-content:center; box-shadow:0 2px 6px rgba(0,0,0,0.3); transition:0.3s; z-index:1000;}
#closeMap:hover { background:darkred; }

/* =========================================
INSTALLED APP BUTTON
========================================= */

.cards1{

    position:fixed;

    bottom:20px;
    right:20px;

    z-index:99999;

    display:flex;
    justify-content:center;
    align-items:center;
}

/* CARD */

.card2{

    display:flex;
    flex-direction:column;

    gap:10px;

    padding:14px;

    border-radius:24px;

    background:rgba(15,23,42,0.88);

    backdrop-filter:blur(20px);

    border:1px solid rgba(255,255,255,0.08);

    box-shadow:
        0 10px 35px rgba(0,0,0,0.35),
        inset 0 1px 0 rgba(255,255,255,0.06);

    min-width:220px;
}

/* BUTTON BASE */

.add-button,
.add-button2{

    display:flex;

    justify-content:center;
    align-items:center;

    width:100%;

    min-height:52px;

    border-radius:18px;

    cursor:pointer;

    user-select:none;

    transition:all .25s ease;

    text-align:center;

    overflow:hidden;
}

/* INSTALL BUTTON */

.add-button{

    background:
        linear-gradient(
            180deg,
            #3b82f6,
            #2563eb
        );

    color:white;
}

.add-button:hover{

    transform:translateY(-2px);

    box-shadow:
        0 8px 18px rgba(37,99,235,0.45);
}

/* OPEN BUTTON */

.add-button2{

    background:
        linear-gradient(
            180deg,
            #10b981,
            #059669
        );

    color:white;
}

.add-button2:hover{

    transform:translateY(-2px);

    box-shadow:
        0 8px 18px rgba(5,150,105,0.45);
}

/* TEXT */

.c1{

    padding:10px 14px;

    font-size:14px;

    font-weight:700;

    line-height:1.4;

    letter-spacing:.2px;
}

/* =========================================
FOOTER
========================================= */

footer{

    width:100%;

    margin-top:30px;
    margin-bottom:80px;

    padding:30px 20px;

    display:flex;

    flex-direction:column;

    align-items:center;

    justify-content:center;

    gap:14px;

    text-align:center;

    color:rgba(255,255,255,0.75);

    font-size:14px;
}

/* MAIL */

.new{

    color:rgba(255,255,255,0.75);

    font-size:14px;
}

.btn-form{

    color:white;

    text-decoration:none;

    font-weight:600;
}

.btn-form:hover{

    text-decoration:underline;
}

/* PRIVACY BUTTON */

#open-privacy{

    margin-top:4px;
}

/* =========================================
MOBILE
========================================= */

@media(max-width:600px){

    .cards1{

        right:10px;
        left:10px;

        bottom:10px;
    }

    .card2{

        width:100%;

        min-width:0;
    }

    .c1{

        font-size:13px;
    }

    .search-btn img{
        width: auto;
        max-width: 30px
    }
    .map-btn img{
        width: auto;
        max-width: 35px
    }

}