* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
    color: #2b2b2b;
    background: #fdf6ec;
}

a {
    color: #b5651d;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.sito-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 0.75rem 1.5rem;
    background: #2b2b2b;
}

.sito-header .logo {
    font-size: 1.4rem;
    font-weight: bold;
    color: #fdf6ec;
}

.nav-principale {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-principale a {
    color: #fdf6ec;
}

.contenuto-principale {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem;
}

.sito-footer {
    text-align: center;
    padding: 1.5rem;
    color: #7a7a7a;
    font-size: 0.9rem;
}

.form-standard {
    display: flex;
    flex-direction: column;
    max-width: 400px;
    gap: 0.35rem;
}

.form-standard label {
    font-weight: bold;
    margin-top: 0.75rem;
}

.form-standard input,
.form-standard select,
.form-standard textarea {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.form-standard button {
    margin-top: 1.25rem;
    padding: 0.6rem 1rem;
    background: #b5651d;
    color: #fdf6ec;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    align-self: flex-start;
}

.form-standard button:hover {
    background: #8f4e16;
}

.messaggio-errore {
    color: #a3282f;
    background: #fbe3e3;
    border: 1px solid #a3282f;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
}

.messaggio-info {
    background: #eaf3ea;
    border: 1px solid #4a7c4a;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 1rem;
}

.messaggio-info button {
    margin-left: 0.5rem;
    padding: 0.3rem 0.6rem;
    border: 1px solid #4a7c4a;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}

.contenitore-mappa {
    height: 70vh;
    width: 100%;
    border-radius: 4px;
}

.popup-gatto {
    max-width: 240px;
}

.popup-gatto img {
    width: 100%;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.popup-gatto h3 {
    margin: 0 0 0.35rem;
}

.badge-elenco {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
}

.badge-gatto {
    background: #f0e0cc;
    color: #6b4423;
    border-radius: 3px;
    padding: 0.1rem 0.4rem;
    font-size: 0.75rem;
}

.popup-meta {
    color: #7a7a7a;
    font-size: 0.8rem;
}

.popup-azioni {
    margin: 0.5rem 0;
}

.popup-mi-piace {
    padding: 0.3rem 0.6rem;
    border: 1px solid #b5651d;
    border-radius: 4px;
    background: #fff;
    color: #b5651d;
    cursor: pointer;
}

.popup-commenti {
    border-top: 1px solid #e0d5c5;
    padding-top: 0.5rem;
}

.popup-lista-commenti {
    list-style: none;
    margin: 0 0 0.5rem;
    padding: 0;
    max-height: 120px;
    overflow-y: auto;
    font-size: 0.85rem;
}

.popup-form-commento textarea {
    width: 100%;
    resize: vertical;
    font-size: 0.85rem;
}

.griglia-moderazione {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.scheda-moderazione {
    border: 1px solid #e0d5c5;
    border-radius: 4px;
    padding: 0.75rem;
    background: #fff;
}

.scheda-moderazione img {
    width: 100%;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.scheda-moderazione h3 {
    margin: 0 0 0.25rem;
}

.form-moderazione {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.pulsante-approva,
.pulsante-rifiuta {
    flex: 1;
    padding: 0.4rem;
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
}

.pulsante-approva {
    background: #4a7c4a;
}

.pulsante-rifiuta {
    background: #a3282f;
}

.griglia-profilo {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.scheda-profilo {
    border: 1px solid #e0d5c5;
    border-radius: 4px;
    padding: 0.6rem;
    background: #fff;
}

.scheda-profilo img {
    width: 100%;
    border-radius: 4px;
    margin-bottom: 0.4rem;
}

.scheda-profilo h3 {
    margin: 0 0 0.3rem;
    font-size: 1rem;
}

.badge-stato {
    display: inline-block;
    border-radius: 3px;
    padding: 0.1rem 0.4rem;
    font-size: 0.75rem;
    color: #fff;
}

.badge-stato-in_attesa {
    background: #b58c1d;
}

.badge-stato-approvato {
    background: #4a7c4a;
}

.badge-stato-rifiutato {
    background: #a3282f;
}

.paginazione {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

:root {
    --altezza-header: 60px;
    --altezza-nav-mobile: 64px;
    --margine-nav-mobile: 14px;
    --spazio-pill-mobile: 64px;
}

.sito-header {
    position: sticky;
    top: 0;
    z-index: 500;
    height: var(--altezza-header);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.nav-desktop {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-desktop a {
    color: #fdf6ec;
    padding: 0.3rem 0;
}

.nav-mobile,
.pillola-brand-mobile {
    display: none;
}

@media (max-width: 768px) {
    .sito-header {
        display: none;
    }

    .pillola-brand-mobile {
        display: flex;
        align-items: center;
        gap: 0.4rem;
        position: fixed;
        top: calc(env(safe-area-inset-top) + 10px);
        left: 50%;
        transform: translateX(-50%);
        background: rgba(43, 43, 43, 0.88);
        color: #fdf6ec;
        padding: 0.45rem 1.1rem;
        border-radius: 999px;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
        z-index: 700;
        font-weight: bold;
        font-size: 0.95rem;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    .pillola-brand-mobile a {
        color: inherit;
        display: flex;
        align-items: center;
        gap: 0.4rem;
    }

    .pillola-brand-mobile i {
        color: #b5651d;
    }

    .contenuto-principale {
        padding-top: calc(env(safe-area-inset-top) + var(--spazio-pill-mobile));
        padding-bottom: calc(var(--altezza-nav-mobile) + (var(--margine-nav-mobile) * 2) + env(safe-area-inset-bottom) + 1rem);
    }

    .nav-mobile {
        display: flex;
        position: fixed;
        left: var(--margine-nav-mobile);
        right: var(--margine-nav-mobile);
        bottom: calc(env(safe-area-inset-bottom) + var(--margine-nav-mobile));
        height: var(--altezza-nav-mobile);
        border-radius: 22px;
        background: rgba(255, 255, 255, 0.94);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
        z-index: 600;
        padding: 0 6px;
    }

    .voce-nav-mobile {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.2rem;
        color: #7a7a7a;
        font-size: 0.68rem;
        text-decoration: none;
    }

    .voce-nav-mobile.voce-attiva {
        color: #b5651d;
        font-weight: bold;
    }

    .icona-nav {
        font-size: 1.15rem;
        border-radius: 12px;
        transition: background 0.2s, padding 0.2s;
    }

    .voce-nav-mobile.voce-attiva .icona-nav {
        background: rgba(181, 101, 29, 0.15);
        padding: 0.3rem 0.7rem;
    }

    .voce-nav-fab {
        position: relative;
    }

    .icona-fab {
        position: absolute;
        top: -24px;
        width: 54px;
        height: 54px;
        border-radius: 50%;
        background: #b5651d;
        color: #fdf6ec;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.4rem;
        box-shadow: 0 6px 16px rgba(181, 101, 29, 0.45);
        border: 3px solid #fdf6ec;
    }

    .solo-desktop {
        display: none;
    }

    .contenitore-mappa {
        margin-top: calc(-1 * (env(safe-area-inset-top) + var(--spazio-pill-mobile)));
        height: calc(100vh - var(--altezza-nav-mobile) - (var(--margine-nav-mobile) * 2) - env(safe-area-inset-bottom));
        border-radius: 0;
    }
}

/* Bottom sheet scheda gatto (solo mobile, vedi mappa.js) */
.scheda-mobile {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: none;
}

.scheda-mobile.visibile {
    display: block;
}

.scheda-mobile-sfondo {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.scheda-mobile-pannello {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 85vh;
    overflow-y: auto;
    background: #fdf6ec;
    border-radius: 16px 16px 0 0;
    padding: 1rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom));
    transform: translateY(100%);
    transition: transform 0.25s ease-out;
}

.scheda-mobile.visibile .scheda-mobile-pannello {
    transform: translateY(0);
}

.scheda-mobile-chiudi {
    display: block;
    margin: 0 auto 0.75rem;
    width: 40px;
    height: 4px;
    border: none;
    border-radius: 2px;
    background: #ccc;
}
