/* Stili Generali */
body {
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Logo e Header */
.top-bar {
    padding: 30px 50px;
}

.logo-container {
    display: flex;
    flex-direction: column;
    width: 100px;
}

/* AGGIUNGI QUESTO BLOCCO: */
.main-logo {
    height: 120px; /* Regola questo valore: 50px o 60px sono l'ideale per le top-bar */
    width: auto; /* Mantiene le proporzioni corrette del tuo PNG */
    object-fit: contain; /* Evita che l'immagine si deformi */
}

.barcode-placeholder {
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 2px;
}

.logo-text {
    font-size: 18px;
    letter-spacing: 4px;
    margin-top: 5px;
}

/* Contenitore delle tre schede */
.cards-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex-grow: 1;
    padding: 20px;
}

/* Stile base delle schede */
.card {
    width: 300px;
    height: 400px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-community { background-color: #e5ebf0; }
.card-search    { background-color: #e2d1e0; }
.card-private   { background-color: #cbb1c8; }

/* --- 1. CARD MAPPA NELLA HOME (PALETTE ELEGANTE) --- */
.card-map {
    background: linear-gradient(135deg, #bca1b9 0%, #7a5b78 100%); 
    background-size: cover;
    background-position: center;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 120px; 
}

.card-map:hover {
    transform: translateY(-5px);
}

.card-map .pill-btn {
    background: white;
    color: #7a5b78;
    border: none;
    padding: 10px 25px;
    border-radius: 25px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    cursor: pointer;
}

/* Stile dei Bottoni e della Barra di ricerca */
.pill-btn, .search-bar {
    background-color: #f7f7f7;
    border: 1px solid #dcdcdc;
    border-radius: 50px;
    padding: 15px 30px;
    font-size: 16px;
    color: #333;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1), inset 0px 2px 4px rgba(255, 255, 255, 0.8);
    cursor: pointer;
    text-align: center;
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: #f7f7f7;
}

.search-bar input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 16px;
    width: 120px;
}

.search-icon {
    font-size: 18px;
    margin-left: 10px;
}

/* --- NUOVI STILI PER LA PAGINA COMMUNITY --- */
.community-section {
    background-color: #e8ecef;
    flex-grow: 1;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    margin: 0 10px;
    padding: 30px 50px;
}

.community-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 50px;
}

.back-btn {
    text-decoration: none;
    font-size: 24px;
    color: #333;
    cursor: pointer;
}

.search-bar.full-width {
    flex-grow: 1;
    justify-content: space-between;
}

.search-bar.full-width input {
    width: 90%;
}

.categories-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px 80px;
    max-width: 900px;
}

.category-pill {
    display: flex;
    align-items: center;
    background-color: #f7f7f7;
    border: 1px solid #dcdcdc;
    border-radius: 50px;
    padding: 15px 25px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1), inset 0px 2px 4px rgba(255, 255, 255, 0.8);
    cursor: pointer;
    font-size: 16px;
    color: #333;
}

.category-pill .emoji {
    font-size: 20px;
    margin-right: 15px;
}

.category-pill .text {
    flex-grow: 1;
    text-align: left;
    letter-spacing: 1px;
}

/* --- STILI PER LA PAGINA CHAT --- */
.chat-layout {
    display: flex;
    gap: 30px;
    height: 600px;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 280px;
}

.sidebar-pill {
    background-color: transparent;
    border: 1px solid #dcdcdc;
    border-radius: 30px;
    padding: 12px 20px;
    text-align: left;
    font-size: 16px;
    color: #333;
    cursor: pointer;
    box-shadow: 0px 2px 4px rgba(0,0,0,0.05);
}

.sidebar-pill.active {
    background-color: #d1d1d1;
    font-weight: bold;
    border-color: #b5b5b5;
}

.chat-window {
    flex-grow: 1;
    background-color: #ffffff;
    border-radius: 15px;
    padding: 20px 30px;
    display: flex;
    flex-direction: column;
    box-shadow: 0px 4px 10px rgba(0,0,0,0.05);
}

.chat-header-title {
    font-size: 22px;
    font-weight: normal;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.chat-messages {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.message {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.msg-content {
    max-width: 80%;
}

.msg-bubble {
    background-color: #2c2b30;
    color: #ffffff;
    padding: 15px 20px;
    border-radius: 20px;
    border-top-left-radius: 0;
    font-size: 14px;
    line-height: 1.4;
}

.chat-input-area {
    display: flex;
    align-items: center;
    border: 1px solid #dcdcdc;
    border-radius: 30px;
    padding: 10px 20px;
    margin-top: 20px;
}

.chat-input-area input {
    flex-grow: 1;
    border: none;
    outline: none;
    margin: 0 15px;
    font-size: 14px;
}

.chat-input-area .icon {
    font-size: 20px;
    color: #888;
    cursor: pointer;
}

/* --- STILI PER LA PAGINA CERCA E MAPPA --- */
.main-content-centered {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    padding: 20px;
}

.cerca-container {
    background-color: #e2d1e0;
    width: 80%;
    max-width: 900px;
    padding: 40px 60px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    box-sizing: border-box;
}

.search-bar.big-search {
    width: 100%;
    box-sizing: border-box;
}

.search-bar.big-search input {
    width: 100%;
}

.location-info {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.normal-pin {
    width: 15px;
    height: 15px;
    background-color: #03a9f4;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

.pulsing-pin {
    width: 15px;
    height: 15px;
    background-color: #ff4757;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(255, 71, 87, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 71, 87, 0); }
}

.custom-leaflet-pin {
    background: none !important;
    border: none !important;
}

/* --- VETRINA MODAL --- */
#vetrina-modal {
    z-index: 10000 !important;
}

#vetrina-content div {
    border-bottom: 1px solid #eee;
    padding: 10px 0;
    font-family: sans-serif;
}


/* ============================================================== */
/* --- STILI UNIFICATI AREA RISERVATA E VENDITORE (MALVA) --- */
/* ============================================================== */

/* Sfondo color malva chiaro (allineato all'area Venditore) */
.private-section {
    background-color: #d6b0cf !important; /* Colore uniforme per tutta l'area riservata */
    flex-grow: 1;
    border-radius: 20px; /* Angoli arrotondati su tutti i lati */
    margin: 0 10px;
    padding: 40px !important;
    display: flex;
    flex-direction: column;
}

.private-layout { 
    display: flex; 
    gap: 30px; 
    width: 100%; 
}

/* Contenitore della lista in colonna */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 320px;
    margin-left: 0; 
    flex-shrink: 0;
}

/* Stile dei singoli bottoni (Effetto vetro trasparente) */
.setting-pill {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.5) !important; 
    border: 2px solid white !important; 
    border-radius: 50px;
    padding: 15px 25px;
    box-shadow: none !important; 
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    color: #444 !important;
    text-align: left;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Effetto al passaggio del mouse */
.setting-pill:hover {
    background: rgba(255, 255, 255, 0.8) !important;
    transform: translateX(5px);
}

/* Bottone attivo (Selezionato scuro) */
.setting-pill.active {
    background-color: #ba9ab4 !important;
    color: #333 !important;
    border: 2px solid white !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important;
}

.setting-pill .emoji {
    font-size: 18px;
    margin-right: 15px;
    width: 25px;
    display: inline-block;
    text-align: center;
}

/* Rettangolo bianco di destra */
.private-content-box { 
    background-color: white; 
    border-radius: 20px; 
    flex-grow: 1; 
    padding: 30px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.05); 
    display: flex; 
    flex-direction: column; 
    gap: 20px; 
}

/* Stili Profilo */
.profile-header { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.profile-pic { width: 70px; height: 70px; border-radius: 50%; object-fit: cover; }
.info-row { display: flex; justify-content: space-between; padding: 15px 0; border-bottom: 1px solid #eee; color: #555; font-size: 14px; text-transform: uppercase; cursor: pointer;}
.info-row span:first-child { color: #333; width: 150px; }

/* Stili Wishlist */
.wishlist-item {
    background-color: #ffffff !important;
    border: 1px solid #e0e0e0;
    border-radius: 15px;
    padding: 15px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.wishlist-img { width: 60px; height: 60px; border-radius: 8px; object-fit: cover; background-color: white; }
.wishlist-text { flex-grow: 1; font-size: 12px; text-transform: uppercase; }
.status-dot { width: 15px; height: 15px; border-radius: 50%; border: 2px solid white; }
.status-dot.green { background-color: #00d053; }
.status-dot.red { background-color: #ff3b3b; }


/* Toggle Switch Verde */
.toggle-pill {
    cursor: default;
    justify-content: space-between;
}
.toggle-switch { position: relative; display: inline-block; width: 48px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: #00d053; }
input:checked + .slider:before { transform: translateX(24px); }


/* --- BOTTONI LATERALI VENDITORE (Stesso stile dell'Area Riservata) --- */
.seller-nav-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.5) !important;
    border: 2px solid white !important;
    padding: 15px 25px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: bold;
    color: #444 !important;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.seller-nav-btn:hover {
    background: rgba(255, 255, 255, 0.8) !important;
    transform: translateX(5px);
}

.seller-nav-btn.active {
    background-color: #ba9ab4 !important;
    color: #333 !important;
    border: 2px solid white !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important;
}

.seller-nav-btn .emoji {
    font-size: 20px;
    width: 24px;
    display: inline-block;
    text-align: center;
}

/* --- MENU A TENDINA MAGAZZINO (ACCORDION) --- */
.accordion-header {
    background-color: #d6b0cf; 
    color: #333;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 1px;
    position: relative;
    z-index: 2;
}

.accordion-body {
    background-color: #e6e6e6; 
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    margin-top: -15px; 
    margin-bottom: 10px;
    padding-top: 15px;
    display: none; 
}

.accordion-body.open {
    display: block; 
}

.accordion-item {
    padding: 12px 20px;
    border-bottom: 1px solid #d4d4d4;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-item:hover {
    background-color: #dcdcdc; 
}

/* --- STILI FORM AGGIUNGI PRODOTTO --- */
.form-input {
    padding: 15px 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    background-color: #fcfcfc;
    color: #333;
}
.form-input:focus {
    border-color: #ba9ab4;
    background-color: #ffffff;
    box-shadow: 0 0 8px rgba(186, 154, 180, 0.3);
}

/* --- STILI SCHEDA CLIENTE --- */
.cliente-card {
    background-color: white;
    border-radius: 20px;
    padding: 30px;
    width: 260px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: transform 0.3s ease;
}

.cliente-card:hover {
    transform: translateY(-5px);
}

.cliente-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cliente-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.cliente-name {
    font-size: 15px;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cliente-text {
    color: #444;
    font-size: 14px;
    line-height: 1.6;
    flex-grow: 1; /* Spinge il bottone in basso */
}

.cliente-btn {
    background-color: #f4f5f7;
    color: #a0a0a0;
    border: none;
    padding: 15px;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 12px;
    transition: all 0.2s;
    width: 100%;
}

.cliente-btn:hover {
    background-color: #e2d1e0;
    color: #333;
}

/* --- STILI RISPOSTA AI (TABELLE MARKDOWN) --- */
#ai-results-content table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-top: 15px; 
    margin-bottom: 20px;
    background: white; 
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
#ai-results-content th, #ai-results-content td { 
    border: 1px solid #eee; 
    padding: 12px 15px; 
    text-align: left; 
}
#ai-results-content th { 
    background: #cbb1c8; /* Usa il malva della tua app */
    color: #333; 
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 1px;
}
#ai-results-content tr:nth-child(even) {
    background-color: #fcfcfc;
}

/* --- STILI MAPPA MODERNA --- */
.map-filter-btn {
    background: white;
    color: #555;
    border: none;
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.map-filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.map-filter-btn.active {
    background: linear-gradient(135deg, #e91e63, #9c27b0);
    color: white;
    box-shadow: 0 4px 10px rgba(156, 39, 176, 0.3);
}

/* Nascondi la scrollbar estetica nei filtri */
#map-filters::-webkit-scrollbar {
    display: none;
}

/* ============================================================== */
/* 📱 ADATTAMENTO MOBILE (RESPONSIVE DESIGN)                      */
/* ============================================================== */

@media (max-width: 768px) {
    /* 1. Header e Barra superiore */
    .top-bar {
        padding: 15px 20px;
    }
    #user-info-bar {
        gap: 10px;
    }
    #nav-user-name {
        display: none !important; /* Nascondiamo il nome per fare spazio alle icone */
    }

    /* 2. Home: Le grandi schede (Community, Ricerca, ecc.) */
    .cards-container {
        flex-direction: column; /* Le impiliamo una sopra l'altra */
        padding: 10px;
        gap: 15px;
    }
    .card {
        width: 100%;
        height: 180px; /* Le facciamo più basse per non occupare tutto lo schermo */
    }

    /* 3. Community: Griglia delle categorie */
    .categories-grid {
        grid-template-columns: 1fr; /* Una singola colonna invece di due */
        gap: 15px;
    }
    .empty-slot { 
        display: none; 
    }
    .community-section {
        padding: 20px 15px;
        margin: 0;
    }

    /* 4. Chat della Community */
    .chat-layout {
        flex-direction: column; /* Il menu laterale va sopra la chat */
        height: auto;
    }
    .sidebar {
        width: 100%;
        flex-direction: row; /* I bottoni si mettono in riga... */
        overflow-x: auto;    /* ...e diventano scorrevoli orizzontalmente! */
        padding-bottom: 10px;
    }
    .sidebar-pill {
        white-space: nowrap;
        padding: 8px 15px;
    }
    .chat-window {
        height: 60vh; /* Diamo un'altezza fissa alla chat sul telefono */
        padding: 15px;
    }

    /* 5. Vista Ricerca AI e Mappa */
    #search-view > div {
        padding: 0 !important; /* Togliamo il padding esagerato ai lati */
    }
    #search-view > div > div:first-child,
    #search-view > div > div:last-child {
        padding: 20px 15px !important; /* Riduciamo i margini interni dei blocchi lilla */
    }
    .search-bar.big-search input {
        font-size: 14px !important;
    }
    #map-view > div > div:first-child {
        padding: 20px 15px !important;
    }

    /* 6. Area Riservata (Profilo, Wishlist, Venditore) */
    .private-section {
        padding: 20px 15px !important;
        margin: 0;
    }
    .private-layout {
        flex-direction: column; /* Impiliamo menu e contenuto */
    }
    .settings-list {
        width: 100%;
        flex-direction: row;
        overflow-x: auto; /* Il menu laterale diventa scorrevole in alto */
        padding-bottom: 10px;
    }
    .setting-pill {
        white-space: nowrap;
        padding: 10px 15px;
    }

    /* 7. Specifiche del Venditore */
    .seller-container {
        flex-direction: column !important;
    }
    .seller-sidebar {
        width: 100% !important;
        flex-direction: row !important;
        overflow-x: auto;
    }
    .seller-nav-btn {
        white-space: nowrap;
    }
    #seller-detail-view > div, 
    #seller-analysis-view > div {
        flex-direction: column; /* Le colonne dei dettagli e dei grafici si impilano */
        gap: 20px !important;
    }

    /* 8. Widget Chat Privata (Apre a tutto schermo sul telefono!) */
    #chat-widget {
        width: 100% !important;
        height: 100% !important;
        bottom: 0 !important;
        right: 0 !important;
        border-radius: 0 !important;
        z-index: 100000 !important;
    }
    #chat-widget > div:first-child {
        border-radius: 0 !important;
    }

    /* 9. Modali (Vetrina) */
    #vetrina-modal > div {
        width: 95% !important;
        max-height: 90vh !important;
        padding: 15px !important;
    }

    .main-logo {
        height: 35px; /* Riduciamo l'altezza fissa sul telefono */
        max-width: 200px; /* Limitiamo la larghezza massima */
    }
}

/* ============================================================== */
/* --- NAVIGAZIONE PRINCIPALE E BOTTOM BAR (MOBILE) ---           */
/* ============================================================== */

#app-screen {
    height: 100vh;
    overflow: hidden;
}

.app-nav {
    width: 240px;
    background: white;
    border-right: 1px solid #eee;
    display: flex;
    flex-direction: column;
    padding: 30px 15px;
    gap: 10px;
    z-index: 100;
    box-shadow: 2px 0 10px rgba(0,0,0,0.02);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 20px;
    border: none;
    background: transparent;
    color: #787C7E;
    font-size: 14px;
    font-weight: bold;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-item i {
    font-size: 20px;
    width: 25px;
    text-align: center;
}

.nav-item:hover {
    background: #f9f9f9;
    color: #333;
}

.nav-item.active {
    background: linear-gradient(135deg, #e91e63, #9c27b0);
    color: white;
    box-shadow: 0 4px 10px rgba(156, 39, 176, 0.3);
}

/* ============================================================== */
/* 📱 ADATTAMENTO MOBILE (RESPONSIVE DESIGN)                      */
/* ============================================================== */

@media (max-width: 768px) {
    /* Il menu si trasforma in Bottom Bar */
    .app-nav {
        flex-direction: row;
        width: 100%;
        height: 70px;
        position: fixed;
        bottom: 0;
        left: 0;
        border-right: none;
        border-top: 1px solid #eee;
        padding: 0;
        gap: 0;
        justify-content: space-around;
        background: white;
        box-shadow: 0 -4px 15px rgba(0,0,0,0.05);
        z-index: 1000;
    }

    .nav-item {
        flex-direction: column;
        gap: 5px;
        padding: 10px 5px;
        border-radius: 0;
        font-size: 10px;
        flex-grow: 1;
        justify-content: center;
    }

    .nav-item i { font-size: 20px; }

    .nav-item.active {
        background: transparent;
        color: #e91e63; /* Diventa fucsia senza sfondo */
        box-shadow: none;
    }

    #main-content {
        padding-bottom: 80px !important; /* Spazio per la barra sotto */
    }

    /* Header e Barra superiore più compatti */
    .top-bar { padding: 15px 20px; }
    #user-info-bar { gap: 10px; }
    #nav-user-name { display: none !important; }

    /* Home: Le grandi schede diventano orizzontali/piccole */
    .cards-container {
        flex-direction: column;
        padding: 10px;
        gap: 15px;
    }
    .card {
        width: 100%;
        height: 120px;
    }

    /* Community: Griglia e Chat */
    .categories-grid { grid-template-columns: 1fr; gap: 15px; }
    .empty-slot { display: none; }
    .community-section { padding: 20px 15px; margin: 0; }
    
    .chat-layout { flex-direction: column; height: auto; }
    .sidebar { width: 100%; flex-direction: row; overflow-x: auto; padding-bottom: 10px; }
    .sidebar-pill { white-space: nowrap; padding: 8px 15px; }
    .chat-window { height: 60vh; padding: 15px; }

    /* Ricerca e Mappa */
    .cerca-container { width: 100%; padding: 20px !important; }
    #search-view > div { padding: 0 !important; }
    #search-view > div > div:first-child,
    #search-view > div > div:last-child { padding: 20px 15px !important; }
    .search-bar.big-search input { font-size: 14px !important; }
    #map-view > div > div:first-child { padding: 20px 15px !important; }

    /* Area Riservata */
    .private-section { padding: 20px 15px !important; margin: 0; }
    .private-layout { flex-direction: column; }
    .settings-list { width: 100%; flex-direction: row; overflow-x: auto; padding-bottom: 10px; }
    .setting-pill { white-space: nowrap; padding: 10px 15px; }

    /* Widget Chat Privata a tutto schermo */
    #chat-widget { width: 100% !important; height: 100% !important; bottom: 0 !important; right: 0 !important; border-radius: 0 !important; z-index: 100000 !important; }
    #chat-widget > div:first-child { border-radius: 0 !important; }
    #vetrina-modal > div { width: 95% !important; max-height: 90vh !important; padding: 15px !important; }
}

/* ============================================================== */
/* --- COMMUNITY HUB (BACHECA E CANALI) ---                       */
/* ============================================================== */

.hub-section-title {
    font-size: 14px;
    font-weight: 900;
    color: #9c27b0;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    margin-top: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 1. Negozi in Evidenza (Carosello) */
.promo-carousel {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
}
.promo-carousel::-webkit-scrollbar { display: none; }

.promo-card {
    min-width: 220px;
    background: linear-gradient(135deg, #ffffff, #fdfdfd);
    border: 1px solid #eee;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    flex-shrink: 0;
}
.promo-card-tag {
    background: #e91e63;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 8px;
}

/* 2. Stanze Tematiche (Canali) */
.channel-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: white;
    border-radius: 15px;
    padding: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    border: 1px solid #eee;
}
.channel-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    border-radius: 10px;
    background: #f9f9f9;
    cursor: pointer;
    transition: background 0.2s;
}
.channel-item:hover { background: #f0f0f0; }
.channel-icon { font-size: 20px; color: #9c27b0; }
.channel-info { flex-grow: 1; }
.channel-name { font-weight: bold; color: #333; font-size: 14px; }
.channel-desc { font-size: 12px; color: #777; }

/* 3. Feed Pubblico (Post) */
.feed-post {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    border: 1px solid #eee;
}
.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}
.post-header img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.post-author { font-weight: bold; color: #333; font-size: 14px; display: flex; flex-direction: column; }
.post-time { font-size: 11px; color: #999; font-weight: normal; }
.post-content { font-size: 14px; color: #444; line-height: 1.5; margin-bottom: 15px; }
.post-actions {
    display: flex;
    gap: 15px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}
.post-action-btn {
    background: transparent;
    border: none;
    color: #777;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
}
.post-action-btn:hover { color: #e91e63; }

/* ============================================================== */
/* --- COMMUNITY HUB A GRIGLIA PULITA ---                         */
/* ============================================================== */

/* Griglia per le due sezioni in alto (Offerte e Stanze) */
.hub-top-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

/* Modifiche per renderla responsiva sul telefono */
@media (max-width: 768px) {
    .hub-top-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* ============================================================== */
/* --- FILTRI DISCUSSIONI ---                                     */
/* ============================================================== */
.thread-filter-btn {
    background: white;
    border: 1px solid #eee;
    color: #777;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.thread-filter-btn:hover {
    background: #fdfdfd;
    border-color: #e2d1e0;
    color: #9c27b0;
}
.thread-filter-btn.active {
    background: linear-gradient(135deg, #e91e63, #9c27b0);
    color: white;
    border: none;
    box-shadow: 0 4px 10px rgba(233,30,99,0.2);
}

/* ============================================================== */
/* --- GRIGLIA COMMUNITY BILANCIATA ---                           */
/* ============================================================== */
.community-balanced-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 colonne fisse su PC */
    gap: 20px;
    width: 100%;
}

/* Regole per Tablet e Telefoni */
@media (max-width: 1100px) {
    .community-balanced-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 800px) {
    .community-balanced-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
    .community-balanced-grid { grid-template-columns: 1fr; }
}

.community-cat-btn {
    background: white; 
    border: none; 
    border-radius: 25px; 
    padding: 20px; /* Un po' più proporzionato */
    font-weight: 900; 
    color: #333; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.03); 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; /* Centra icona e testo nel bottone largo */
    gap: 12px; 
    font-size: 15px; 
    transition: all 0.2s;
    
    /* ECCO LA MAGIA: */
    width: 100%; 
    box-sizing: border-box; 
}

.community-cat-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.06);
    color: #9c27b0;
}

.community-cat-btn span {
    font-size: 22px;
}

/* Esempio di classe per l'header del popup, controlla come si chiama nel tuo file */
.popup-header {
    /* Mantenere i colori originali */
    background: linear-gradient(135deg, #2e7d32, #43a047); 
    height: 100px; /* Assumendo un'altezza di 100px */
    
    /* 🌟 MODIFICHE QUI SOTTO 🌟 */
    position: relative; /* Cruciale per posizionare l'avatar */
    border-radius: 20px 20px 0 0; /* Angoli superiori arrotondati, inferiori squadrati */
    overflow: visible; /* FONDAMENTALE: permette all'avatar di uscire */
}

#info-neg-foto {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    
    /* 🌟 NUOVO STILE DI POSIZIONAMENTO 🌟 */
    position: absolute; /* Posizionamento assoluto rispetto all'header */
    top: 100%; /* Lo posiziona esattamente sotto l'header verde */
    left: 50%; /* Lo centra orizzontalmente */
    
    /* Centra perfettamente a cavallo (metà cerchio su verde, metà su bianco) */
    transform: translate(-50%, -50%); 
    
    border: 5px solid white; /* Bordo bianco spesso per contrasto */
    object-fit: cover;
    background: white;
    z-index: 10; /* Assicura che sia sopra l'header */
    
    /* Una nuova ombra sottile e pulita */
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); 
}

/* Stile per il link del sito vetrina dentro l'app */
.nav-site-link {
    text-decoration: none; /* Rimuove la sottolineatura classica dei link */
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 20px;
    color: #787C7E;
    font-size: 14px;
    font-weight: bold;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.nav-site-link:hover {
    background: #f9f9f9;
    color: #9c27b0; /* Diventa viola al passaggio del mouse */
}

/* Adattamento per la Bottom Bar su Mobile (smartphone) */
@media (max-width: 768px) {
    .nav-site-link {
        flex-direction: column;
        gap: 5px;
        padding: 10px 5px;
        border-radius: 0;
        font-size: 10px;
        flex-grow: 1;
        justify-content: center;
    }
    
    .nav-site-link i {
        font-size: 20px;
    }
}