/* ============================================================
   RESET E BASE
   ============================================================ */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body { 
    font-family: 'Roboto', sans-serif; 
    background-color: #1a1a1a; 
    color: #f4f4f4; 
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}

main { width: 100vw; }

h1, h2, h3, .logo { 
    margin-top: auto;
    font-family: 'Oswald', sans-serif; 
    text-transform: uppercase; 
}

/* ============================================================
   NAVIGAZIONE (NAVBAR) - DESKTOP BASE
   ============================================================ */
.navbar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 15px 5%; 
    background: #000; 
    border-bottom: 3px solid #556b2f; 
    position: relative; /* Necessario per z-index */
    z-index: 100;
}

.logo { 
    font-size: 1.5rem; 
    color: #fff; 
    text-decoration: none; 
    font-weight: bold; 
}

.logo span { color: #556b2f; }

.nav-links { 
    display: flex; 
    list-style: none; 
    gap: 20px; 
    align-items: center; 
}

.nav-links a { 
    color: #fff; 
    text-decoration: none; 
    font-weight: bold; 
    font-size: 0.9rem; 
}

/* STILI DROPDOWN (Globali) */
.dropdown {
    position: relative;
    padding-bottom: 10px;
    margin-bottom: -10px;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #2a2a2a;
    min-width: 180px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.5);
    z-index: 1000;
    border-radius: 4px;
    top: 100%; /* Si posiziona esattamente sotto */
    left: 50%;
    transform: translateX(-50%); /* Centrato rispetto al genitore */
    padding-top: 5px;
}

.dropdown-content a {
    color: white;
    padding: 12px 16px;
    display: block;
    white-space: nowrap; /* Evita che il testo vada a capo */
}

.dropdown-content a:hover {
    background-color: #556b2f;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropbtn { cursor: pointer; }

/* BADGE NOTIFICHE */
.badge {
    background-color: #ff3b30;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    padding: 0 5px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-left: 8px;
    vertical-align: middle;
    transform: translateY(-1px);
}

.badge-small {
    background-color: #ff3b30;
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero { 
    padding: 100px 20px; 
    background: linear-gradient(rgba(0,0,0,0.75), rgba(0,0,0,0.75)), no-repeat center center/cover; 
    text-align: center; 
}

.hero h1 { 
    font-size: 3rem; 
    margin-bottom: 15px; 
    letter-spacing: 2px; 
}

.hero p { 
    font-size: 1.2rem; 
    margin-bottom: 30px; 
    color: #ccc; 
}

.hero-btns { 
    display: flex; 
    gap: 15px; 
    justify-content: center; 
    flex-wrap: wrap; 
    margin-top: 20px; 
}

.btn-primary, .btn-secondary {
    display: inline-block !important;
    padding: 15px 30px !important;
    text-decoration: none !important;
    font-weight: bold !important;
    text-transform: uppercase !important;
    border-radius: 5px !important;
    transition: 0.3s !important;
    text-align: center !important;
    min-width: 200px;
    border: none;
    cursor: pointer;
}

.btn-primary { background-color: #556b2f !important; color: white !important; }
.btn-primary:hover { background-color: #6b8e23 !important; }
.btn-secondary { background-color: transparent !important; color: white !important; border: 2px solid white !important; }
.btn-secondary:hover { background-color: white !important; color: black !important; }

/* ============================================================
   AUTH & FORMS
   ============================================================ */
.auth-page {
    background-size: cover;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 40px 20px;
}

.auth-container {
    background: rgba(20, 20, 20, 0.95);
    border: 2px solid #556b2f;
    border-radius: 10px;
    display: flex;
    max-width: 950px;
    width: 100%;
    box-shadow: 0 0 40px rgba(0,0,0,0.7);
    position: relative;
    flex-wrap: wrap;
    overflow: hidden;
}

.auth-box { flex: 1; padding: 45px; min-width: 320px; }
.auth-box h2 { color: #556b2f; margin-bottom: 25px; font-size: 1.8rem; border-bottom: 2px solid #333; padding-bottom: 10px; text-align: center; }
.auth-box p { font-size: 0.95rem; color: #aaa; margin-bottom: 25px; text-align: center; }
.auth-divider { width: 2px; background: linear-gradient(to bottom, transparent, #556b2f, transparent); margin: 40px 0; }

.input-group { margin-bottom: 20px; }
.input-group label { display: block; color: #8da45f; font-weight: bold; font-size: 0.8rem; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px; }
.input-group input, .input-group select { width: 100%; padding: 12px; background: #111; border: 1px solid #444; color: white; border-radius: 4px; font-family: 'Roboto', sans-serif; }
.input-group input:focus { border-color: #556b2f; outline: none; background: #1a1a1a; }
.checkbox-group { display: flex; gap: 10px; margin-bottom: 25px; font-size: 0.85rem; color: #ccc; line-height: 1.3; }
.full-width { width: 100%; }
.forgot-pw { display: block; text-align: center; margin-top: 15px; color: #666; text-decoration: none; font-size: 0.85rem; }
.forgot-pw:hover { color: #8da45f; }
.back-home { position: absolute; bottom: 20px; width: 100%; text-align: center; }
.back-home a { color: #fff; text-decoration: none; font-size: 0.9rem; opacity: 0.6; }

/* ============================================================
   SEARCH & CONTENT
   ============================================================ */
.search-bar-section { background: #000; padding: 25px; border-bottom: 2px solid #556b2f; }
.search-form { display: flex; gap: 10px; max-width: 1100px; margin: 0 auto; flex-wrap: wrap; }
.search-form input, .search-form select { flex: 1; min-width: 180px; padding: 12px; background: #2a2a2a; border: 1px solid #444; color: white; border-radius: 4px; }
.search-form button { background: #556b2f; color: white; border: none; padding: 0 30px; font-weight: bold; cursor: pointer; border-radius: 4px; text-transform: uppercase; }

.container { max-width: 1200px; margin: 40px auto; padding: 0 20px; }
.section-title { color: #556b2f; margin: 0 auto 40px auto; text-align: center; display: table; padding: 0 20px 10px 20px; border-bottom: 3px solid #556b2f; font-size: 2.2rem; }

.annunci-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 25px; }
.scheda-item { background: #2a2a2a; border: 1px solid #333; border-radius: 10px; overflow: hidden; transition: 0.3s; position: relative; }
.scheda-item:hover { transform: translateY(-5px); border-color: #556b2f; }
.immagine-item { height: 200px; background-size: cover; background-position: center; position: relative; }
.info-item { padding: 20px; }
.price { font-size: 1.4rem; font-weight: bold; color: #fff; display: block; margin: 10px 0; }
.btn-view { display: block; text-align: center; background: #333; color: #fff; text-decoration: none; padding: 10px; border-radius: 4px; border: 1px solid #444; }
.btn-view:hover { background: #556b2f; border-color: #556b2f; }

/* TAG CATEGORIA */
.tag-categoria { position: absolute; top: 10px; left: 10px; padding: 5px 12px; font-size: 0.75rem; font-weight: bold; text-transform: uppercase; border-radius: 3px; color: #fff; z-index: 2; }
.tag-categoria.softair { background-color: #556b2f; }
.tag-categoria.lasertag { background-color: #d35400; }
.tag-categoria.attrezzatura { background-color: #0CADED; }
.tag-categoria.accessori { background-color: #4a4848; }

/* ============================================================
   FOOTER
   ============================================================ */
footer { background: #000; padding: 50px 20px; text-align: center; border-top: 2px solid #333; margin-top: 60px; width: 100%; }
footer p { color: #888; font-size: 0.9rem; max-width: 800px; margin: 0 auto; }
footer a { color: #8da45f; text-decoration: none; font-weight: bold; transition: 0.3s; }
footer a:hover { color: #fff; text-decoration: underline; }
.footer-item { display: flex; justify-content: space-between; align-items: center; margin-top: 15px; }
.location { font-size: 0.85rem; color: #8da45f; margin-top: 5px; }

/* ============================================================
   MOBILE RESPONSIVE (MEDIA QUERY)
   ============================================================ */
@media (max-width: 768px) {
    /* Navbar Verticale */
    .navbar {
        flex-direction: column; 
        align-items: center;
        gap: 15px;
        padding: 15px;
    }

    .nav-links {
        flex-direction: column; /* Link in colonna */
        width: 100%;
        gap: 0; /* Rimuoviamo il gap, usiamo il padding dei li */
    }

    .nav-links li {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid #333; /* Linea separatrice */
    }
    
    .nav-links li:last-child {
        border-bottom: none;
    }

    .nav-links a, .dropbtn {
        display: block;
        padding: 15px 0;
        width: 100%;
    }

    /* FIX DROPDOWN SU MOBILE */
    /* Invece di fluttuare (absolute), si apre dentro la lista (relative) spingendo il resto giù */
    .dropdown-content {
        position: relative; 
        top: 0;
        left: 0;
        transform: none;
        width: 100%;
        box-shadow: none;
        background-color: #222; /* Leggermente più chiaro dello sfondo */
        margin-top: 0;
        padding-top: 0;
    }

    .dropdown-content a {
        padding: 15px;
        border-top: 1px solid #333;
        font-size: 0.85rem;
        color: #ccc;
    }

    /* Altri aggiustamenti Mobile */
    .hero h1 { font-size: 2rem; }
    .hero-btns { flex-direction: column; align-items: center; }
    .btn-primary, .btn-secondary { width: 90%; }
    .search-form { flex-direction: column; }
    .search-form input, .search-form select, .search-form button { width: 100%; height: 50px; }
    .section-title { font-size: 1.6rem; }
    .auth-container { flex-direction: column; }
    .auth-divider { width: 80%; height: 2px; margin: 40px auto; background: linear-gradient(to right, transparent, #556b2f, transparent); }
}

/* ==========================================================================
   STILE GLOBALE "GLASSMORPHISM" E UNIFORMAZIONE SITO
   ========================================================================== */

/* 1. Sfondo globale fotografico fisso per TUTTE le pagine */
body {
    background-image: linear-gradient(to bottom, rgba(17,17,17,0.1) 0%, rgba(17,17,17,1) 900px), url('graphics/bg.png') !important;
    background-size: 100% auto !important;
    background-position: center top !important;
    background-repeat: no-repeat !important;
    background-color: #111 !important;
    background-attachment: fixed !important;
}

/* 2. Forza la trasparenza sulle sezioni centrali senza toccare la barra di navigazione in alto */
.search-bar-section, .hero {
    background-color: transparent !important;
    background: transparent !important;
}

/* 3. Effetto "Vetro" (Glassmorphism) - Intercetta anche gli stili scritti nel PHP */
.terms-content, .privacy-content, .product-detail, .feedback-container, 
.auth-box, .maintenance-box, .message-card, .my-card, .gdpr-section, 
.section-box, .approval-card, .seller-box, .specs-grid,
div[style*="background: #2a2a2a"], 
div[style*="background: #1a1a1a"], 
div[style*="background: #222"] {
    background: rgba(25, 25, 25, 0.70) !important; /* Grigio trasparente al 70% */
    backdrop-filter: blur(8px) !important; /* Sfocatura dello sfondo fotografico */
    -webkit-backdrop-filter: blur(8px) !important; /* Per compatibilità iPhone */
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

/* 4. Uniforma tutti i campi di testo, ricerca e tendine */
input[type="text"], input[type="email"], input[type="password"], textarea, select {
    background: rgba(0, 0, 0, 0.7) !important;
    border: 1px solid #c3b689 !important; /* Bordo Khaki */
    color: white !important;
}

/* 5. Uniforma tutti i pulsanti principali all'arancione/khaki della Home */
.btn-primary, button[type="submit"] {
    background-color: #e58b47 !important;
    border: none !important;
    color: white !important;
    font-weight: bold !important;
    transition: background-color 0.3s, transform 0.2s !important;
}

.btn-primary:hover, button[type="submit"]:hover {
    background-color: #d35400 !important;
    transform: scale(1.02);
}

/* 6. Uniforma le scritte dei filtri e i titoli */
.adv-group label, .section-title, .profile-header h1 span { 
    color: #c3b689 !important; 
}


