:root {
    --primary: #157B6E; /* Nuovo Verde RobaDaCani */
    --accent: #EF6733;  /* Nuovo Arancio RobaDaCani */
    --bg-main: #fcfcfc;
    --card-bg: #ffffff;
    --text-main: #2d3436;
    --text-muted: #636e72;
    --radius: 16px;
    --shadow: 0 10px 30px rgba(0,0,0,0.05);
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6, .navbar-brand {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 20px 0;
}

/* Il logo e' testo, non un'immagine: la sua dimensione e' questa riga. Il 10% in
   meno rispetto ai 2.2rem di partenza. Il logo del footer non lo segue: ha un
   font-size inline di 1.4rem nei template. */
.navbar-brand {
    font-size: 1.98rem;
    letter-spacing: -1.5px;
    font-weight: 900;
    text-transform: lowercase;
    background: linear-gradient(135deg, #005f56 0%, #81c784 100%);
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    display: inline-block;
    transition: all 0.3s ease;
}

.logo-dot {
    font-weight: 900;
    background: linear-gradient(135deg, #EF6733 0%, #ffb74d 100%);
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    display: inline-block;
}

/* Site Header V3 */
.site-header {
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    z-index: 1060 !important; /* Superiore allo sticky della sidebar */
}

/* Il logo al centro su smartphone.
   Sotto i 768 px la barra di ricerca e' gia' nascosta (d-none d-md-block), quindi
   nella riga restano solo il logo e il bottone del menu, e il justify-content-between
   dei template li spara ai due lati opposti. Si centra il logo mettendo il bottone
   fuori dal flusso, invece che il logo: cosi' e' il logo a dare l'altezza alla riga
   e non serve toccarne il posizionamento.
   Il breakpoint e' 767.98 e non 768 apposta: a 768 px esatti Bootstrap fa gia'
   ricomparire la ricerca, e a quel punto il logo va a sinistra come prima. */
@media (max-width: 767.98px) {
    .header-main-row > .container {
        position: relative;
        justify-content: center !important;
    }

    .header-main-row .navbar-toggler {
        position: absolute;
        right: calc(var(--bs-gutter-x, 1.5rem) * 0.5);
        top: 50%;
        transform: translateY(-50%);
        padding-right: 0;
    }
}

/* Modern 2026 Search Bar */
.search-premium-container {
    position: relative;
    width: 100%;
    max-width: 550px; /* Più larga per un look più "search-centric" */
    margin-left: auto;
    z-index: 1070;
}

.search-premium-container .input-group {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.08) !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03) !important;
    height: 52px;
    border-radius: 100px !important;
    padding: 3px 3px 3px 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-premium-container .input-group:focus-within {
    background: #ffffff;
    box-shadow: 0 8px 30px rgba(21, 123, 110, 0.1) !important;
    border-color: var(--primary) !important;
}

.search-premium-container .input-group-text {
    background: transparent !important;
    border: none !important;
    padding-left: 10px;
    color: var(--primary);
    opacity: 0.5;
    font-size: 1rem;
}

.search-premium-container input {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
}

.search-premium-container .btn-success {
    background: var(--primary) !important;
    border: none !important;
    border-radius: 100px !important;
    padding: 0 35px !important;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.search-premium-container .btn-success:hover {
    transform: none;
    background: #1a7a6d !important;
    filter: brightness(1.1);
}

/* Modern Professional Category Nav */
.header-menu-row {
    background: #ffffff;
    border-top: 1px solid rgba(0,0,0,0.05);
    border-bottom: 1px solid rgba(0,0,0,0.02);
}

.main-category-nav .nav-item {
    margin: 4px 1px;
}

.main-category-nav .nav-link {
    color: #4a5568 !important;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 8px 12px !important;
    letter-spacing: 0.3px;
    border-radius: 100px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
}

.main-category-nav .nav-link i {
    color: var(--primary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.main-category-nav .nav-link:hover {
    background: #f0f7f4;
    color: var(--primary) !important;
    border-color: rgba(21, 123, 110, 0.1);
}

.main-category-nav .nav-link.active {
    background: var(--primary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(21, 123, 110, 0.2);
}

.main-category-nav .nav-link.active i {
    color: #ffffff !important;
}

/* Dropdown dei risultati coerente con lo stile 2026 */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 4px;
    right: 4px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    margin-top: 12px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
    border: 1px solid rgba(0,0,0,0.05);
    overflow: hidden;
    z-index: 1100;
}

@media (max-width: 768px) {
    .search-results-dropdown {
        position: relative !important;
        top: 0 !important;
        min-width: 100% !important;
        margin-top: 10px !important;
        z-index: 10000 !important;
        box-shadow: none !important;
        border: 1px solid rgba(0,0,0,0.05) !important;
        max-height: none !important;
    }
    
    .search-premium-container {
        max-width: 100% !important;
    }
}

/* Hero Section */
.hero {
    background: #ffffff;
    padding: 60px 0 30px 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.8rem;
    color: var(--primary);
    margin-bottom: 10px;
    letter-spacing: -1.5px;
}

/* Post Cards */
.post-card {
    border: none;
    border-radius: var(--radius);
    background: var(--card-bg);
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    height: 100%;
    position: relative; /* Fondamentale per stretched-link */
    overflow: hidden;
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.post-card img {
    border-radius: var(--radius) var(--radius) 0 0;
    height: 240px;
    width: 100%;
    object-fit: cover;
    display: block;
}

.post-card-img-wrapper {
    position: relative;
    /* Niente z-index qui. L'overlay di .stretched-link e' un ::after con
       z-index: 1 (Bootstrap 5.3): con z-index: 2 l'immagine gli finiva sopra e
       restava l'unico punto NON cliccabile della scheda - cioe' il piu' grande
       e quello su cui si clicca per istinto. Il border-radius non ha bisogno di
       z-index, lo taglia gia' overflow: hidden su .post-card. */
}

.post-card .card-body {
    padding: 30px;
}

.card-category {
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.card-meta {
    border-left: 3px solid var(--accent);
    padding-left: 12px;
    margin-bottom: 20px;
    line-height: 1.2;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.author-mini {
    display: flex;
    align-items: center;
    gap: 8px;
}

.author-mini img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(0,0,0,0.05);
}

.card-meta-author {
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.card-meta-time {
    font-size: 0.72rem;
    color: var(--text-muted);
    opacity: 0.8;
}

/* Post Meta - Professional Layout */
.post-meta-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    padding: 20px 0;
    border-top: 1px solid rgba(0,0,0,0.06);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    margin: 25px 0 35px 0;
}

.post-author-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.post-author-box .author-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.author-details {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.author-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

.author-name-val {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

.post-meta-info {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.meta-item {
    font-size: 0.82rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    font-weight: 500;
}

.meta-item i {
    color: var(--accent);
    font-size: 0.95rem;
    margin-right: 6px;
}

.card-tag {
    text-transform: uppercase;
    font-size: 0.65rem;
    font-weight: 700;
    background: #fff3e0;
    color: #e65100;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #ffe0b2;
    letter-spacing: 0.5px;
    display: inline-block;
    vertical-align: middle;
    margin-bottom: 10px;
    margin-left: 5px;
}

/* Product Box - Full Width & Professional */
.product-box {
    background: #ffffff;
    border-radius: 20px;
    margin: 40px 0;
    border: 1px solid rgba(0,0,0,0.08) !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.04);
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
    width: 100%;
}

.product-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(0,0,0,0.08);
}

.badge-choice {
    position: absolute;
    top: 0;
    left: 0;
    background: linear-gradient(135deg, #157B6E 0%, #4caf50 100%);
    color: white;
    padding: 6px 15px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    border-bottom-right-radius: 15px;
    z-index: 10;
}

.merchant-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #8e2de2 0%, #4a00e0 100%); /* Gradiente Viola-Azzurro Elettrico */
    border: none;
    padding: 5px 14px;
    border-radius: 100px; /* Più arrotondato per questo stile */
    font-size: 0.65rem;
    font-weight: 700;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(74, 0, 224, 0.2);
    z-index: 5;
}

.merchant-badge i {
    color: #ffffff; /* Icona Bianca */
    font-size: 0.7rem;
    opacity: 0.9;
}

.price-tag {
    font-size: 2rem;
    font-weight: 900;
    color: #1a1a1a;
    margin: 8px 0;
    letter-spacing: -0.5px;
}

.price-tag .current-price {
    background: linear-gradient(90deg, #157B6E 0%, #2e7d32 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.old-price {
    font-size: 1rem;
    color: #adb5bd;
    text-decoration: line-through;
    font-weight: 400;
    margin-right: 10px;
}

.btn-buy {
    background: #EF6733 !important;
    color: #000 !important;
    border-radius: 100px;
    padding: 10px 25px;
    font-weight: 800;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    border: 2px solid rgba(0,0,0,0.08);
    text-transform: uppercase;
    font-size: 0.8rem;
    box-shadow: 0 6px 18px rgba(255,152,0,0.25);
}

.btn-buy:hover {
    background: #fb8c00 !important;
    color: #000 !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(251,140,0,0.35);
}

/* Comparison Table Compact */
.comparison-table {
    background: #fcfdfc;
    padding: 20px;
    border-top: 1px solid #f0f0f0;
}

.comparison-row {
    background: white;
    border: 1px solid #eee !important;
    padding: 10px 15px !important;
    border-radius: 12px !important;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.comparison-row:hover {
    border-color: #157B6E !important;
    background: #f8faf8 !important;
    transform: scale(1.01);
}

.comparison-row .badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 600;
}

/* Typography Improvements */
.post-content {
    font-size: 1.15rem;
    color: #444;
}

/* Tabella Soft Pastel Modern */
.post-content table {
    width: 100%;
    margin: 40px 0;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 16px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e8f0e8;
    box-shadow: 0 10px 25px rgba(26, 83, 27, 0.04);
}

.post-content table thead tr {
    background: #f1f7f1; /* Verde salvia chiarissimo */
}

.post-content table th {
    color: #4a6b4c !important; /* Verde bosco desaturato */
    padding: 18px 25px;
    font-weight: 700;
    text-align: left;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid #e2eee2;
}

.post-content table td {
    padding: 20px 25px;
    border-bottom: 1px solid #f4f9f4;
    vertical-align: middle;
    font-size: 1rem;
    color: #444;
}

.post-content table tr:nth-child(even) td {
    background-color: #fafdfa; /* Tocco di menta pastello */
}

.post-content table tr:hover td {
    background-color: #f0f7f0;
    transition: background-color 0.3s ease;
}

/* Bottone Delicato ma Visibile */
.post-content table td a:contains("Scopri"), 
.post-content table td a:contains("Verifica"),
.post-content table td a.btn-amazon {
    background: #e67e22; /* Arancio corallo delicato */
    color: #ffffff !important;
    padding: 10px 22px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.2);
    border: none;
}

.post-content table td a:hover {
    background: #157B6E; /* Passa al verde bosco del brand */
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(26, 83, 27, 0.15);
    color: #ffffff !important;
}

/* Fix per link in tabella */
.post-content table td a {
    color: #157B6E;
    font-weight: 600;
    text-decoration: none;
}

.post-content table td a:hover {
    text-decoration: underline;
}

/* Stile speciale per pulsanti Amazon in tabella */
.post-content table td a.btn-amazon {
    background: #EF6733;
    color: #000 !important;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 800;
    display: inline-block;
    box-shadow: 0 4px 12px rgba(255,152,0,0.2);
    transition: all 0.2s ease;
    text-transform: uppercase;
    white-space: nowrap;
}

.post-content table td a.btn-amazon:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255,152,0,0.3);
    text-decoration: none;
    background: #fb8c00;
}

.post-content table tr:last-child td {
    border-bottom: none;
}

.post-content table tr:nth-child(even) {
    background-color: #fafdfa;
}

.post-content table tr:hover td {
    background-color: #f0f7f0;
    transition: background-color 0.2s ease;
}

/* Tabelle degli articoli su smartphone.
   Il problema non e' che sfondano: e' che si strizzano. Con 25 px di padding per
   cella, su uno schermo da 375 px una tabella a tre colonne lascia ~75 px utili
   per colonna, il testo va a capo a una parola per riga e la riga diventa alta
   quanto mezzo schermo.
   Lo scorrimento orizzontale, che era la soluzione precedente, non risolve: su un
   articolo nessuno si accorge che la tabella scorre, e le colonne a destra
   restano non lette. E non tutte le tabelle hanno lo stesso problema — quella
   delle dosi (peso, kcal, grammi) sta in larghezza da sola e spezzarla in schede
   la peggiora.
   Cosi' e' functions.php (tabelleResponsive) a misurare la cella piu' lunga e a
   mettere una classe sul contenitore. Qui ci sono i due trattamenti:
     .rdc-tabella--stretta  resta tabella, con padding e corpo ridotti;
     .rdc-tabella--scheda   una riga = una scheda, prima cella come titolo e le
                            altre etichettate col nome della colonna, che arriva
                            in data-rdc.
   Il fallback su .post-content table senza contenitore serve alle tabelle che
   non passano da renderPostContent(): li' si torna allo scorrimento. */
@media (max-width: 767.98px) {
    .post-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 12px;
        margin: 28px 0;
    }

    .post-content table th,
    .post-content table td {
        padding: 14px 16px;
        min-width: 9.5rem;
    }

    .post-content table td {
        font-size: 0.95rem;
    }

    .post-content table th {
        padding-top: 14px;
        padding-bottom: 14px;
        font-size: 0.72rem;
        letter-spacing: 0.5px;
    }

    /* --- tabella stretta: ci sta, basta togliere il grasso ------------------ */
    .post-content .rdc-tabella--stretta table {
        display: table !important;
        width: 100%;
        overflow: visible;
        margin: 26px 0;
    }

    .post-content .rdc-tabella--stretta th,
    .post-content .rdc-tabella--stretta td {
        min-width: 0 !important;
        padding: 11px 10px !important;
        overflow-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
    }

    .post-content .rdc-tabella--stretta td { font-size: 0.9rem; }

    .post-content .rdc-tabella--stretta th {
        font-size: 0.63rem;
        letter-spacing: 0.3px;
        padding: 11px 10px !important;
    }

    /* --- tabella a schede --------------------------------------------------- */
    .post-content .rdc-tabella--scheda table {
        display: block;
        overflow: visible;
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        margin: 26px 0;
    }

    .post-content .rdc-tabella--scheda thead,
    .post-content .rdc-tabella--scheda .rdc-riga-testa { display: none !important; }

    .post-content .rdc-tabella--scheda tbody { display: block; }

    .post-content .rdc-tabella--scheda tbody tr {
        display: block;
        background: #ffffff !important;
        border: 1px solid #e8f0e8;
        border-radius: 14px;
        padding: 15px 16px;
        margin-bottom: 12px;
        box-shadow: 0 4px 14px rgba(26, 83, 27, 0.045);
    }

    .post-content .rdc-tabella--scheda tbody tr:last-child { margin-bottom: 0; }

    .post-content .rdc-tabella--scheda tbody td {
        display: block;
        min-width: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        font-size: 0.94rem;
        line-height: 1.5;
        overflow-wrap: break-word;
    }

    /* La prima cella fa da titolo della scheda: e' quasi sempre l'entita' di cui
       parla la riga (il modello, la struttura, il sintomo). */
    .post-content .rdc-tabella--scheda tbody td:first-child {
        font-size: 1rem;
        font-weight: 700;
        color: #2d3436;
        padding-bottom: 11px !important;
        margin-bottom: 11px;
        border-bottom: 1px solid #eef5ee !important;
    }

    .post-content .rdc-tabella--scheda tbody td[data-rdc]::before {
        content: attr(data-rdc);
        display: block;
        font-size: 0.65rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: #7c8d7e;
        margin-bottom: 3px;
    }

    .post-content .rdc-tabella--scheda tbody td + td { margin-top: 11px; }

    .post-content .rdc-tabella--scheda tbody tr:hover td { background: transparent !important; }
}

/* Badge "Scelto dalla Redazione" */
.badge-redazione {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 5px;
    border: 1px solid #c8e6c9;
}

/* Contenitore responsive per tabelle */
.table-responsive {
    border-radius: 16px;
    margin: 40px 0;
}

/* Miglioramento Tabella Admin */
.admin-card .table {
    margin-bottom: 0;
}

.admin-card .table thead th {
    background: #f8fafc;
    border-bottom: 2px solid #edf2f7;
    color: #4a5568;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 15px 25px;
}

.admin-card .table tbody td {
    padding: 15px 25px;
    vertical-align: middle;
    color: #2d3748;
    border-bottom: 1px solid #edf2f7;
}

.admin-card .table tbody tr:hover {
    background-color: #f7fafc;
}

/* Futuristic Category Cards - Compact */
.category-section {
    padding: 15px 0 35px 0;
    background: #f8faf8;
    position: relative;
    z-index: 999; /* Forza la sezione in primo piano */
}

.category-card {
    background: #ffffff;
    border: 1px solid rgba(26, 83, 27, 0.15);
    border-radius: 50px;
    padding: 10px 22px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s ease, border-color 0.2s ease;
    text-decoration: none !important;
    color: var(--text-main);
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.category-card:hover {
    background: #ffffff;
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(26, 83, 27, 0.1);
    /* RIMOSSO OGNI TRANSFORM CHE CAUSA TREMOLIO */
}

.category-card.active {
    background: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
}

.category-card.active .category-icon-wrapper {
    background: rgba(255,255,255,0.2);
    color: white;
}

.category-icon-wrapper {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #f0f7f0 0%, #e8f5e9 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    font-size: 0.85rem;
    color: var(--primary);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.category-card:hover .category-icon-wrapper {
    background: var(--primary);
    color: white;
    transform: rotate(10deg);
}

.category-name {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    line-height: 1;
    white-space: nowrap;
}

.font-xs { font-size: 0.52rem; }
.font-sm { font-size: 0.62rem; }
.font-md { font-size: 0.72rem; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px; /* Evita che l'header copra il titolo dopo il salto */
}

/* Table of Contents */
.toc-container {
    background: #fcfdfc !important;
    max-width: 500px;
}

.toc-title:hover {
    color: var(--primary);
}

.toc-container.collapsed .toc-list {
    display: none;
}

.toc-container.collapsed .toc-toggle-icon {
    transform: rotate(180deg);
}

.toc-toggle-icon {
    font-size: 0.9rem;
    color: #ccc;
}

.toc-item a {
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
}

.toc-item a:hover {
    color: var(--primary) !important;
    transform: translateX(5px);
}

.transition {
    transition: all 0.3s ease;
}

.text-dark-hover:hover {
    color: var(--primary) !important;
}

/* Comparison Table V3 - Professional & Responsive */
.top-comparison-table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 25px rgba(0,0,0,0.06);
    border: 1px solid #edf2ed !important;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.comparison-table-v3 {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* Forza la tabella a rispettare le larghezze */
}

.comparison-table-v3 th, .comparison-table-v3 td {
    padding: 12px;
    vertical-align: middle;
    border-bottom: 1px solid #f8faf8;
    overflow: hidden;
}

/* Larghezze Colonne Desktop */
.comparison-table-v3 th:nth-child(1), .comparison-table-v3 td:nth-child(1) { width: auto; }
.comparison-table-v3 th:nth-child(2), .comparison-table-v3 td:nth-child(2) { width: 100px; }
.comparison-table-v3 th:nth-child(3), .comparison-table-v3 td:nth-child(3) { width: 100px; }

.table-img-wrap {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    position: relative;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    padding: 4px;
}

.table-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.table-badge {
    position: absolute;
    top: -5px;
    left: -5px;
    font-size: 0.55rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 800;
    text-transform: uppercase;
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 5;
}

.table-badge.best { background: #ffce00; color: #000; }
.table-badge.value { background: #157B6E; color: #fff; }

.row-highlight-gold { background: #fffdf5 !important; }
.row-highlight-green { background: #fafffa !important; }

.product-name-toc {
    display: block !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 0.82rem;
    font-weight: 700;
    max-width: 100%;
    margin-bottom: 2px;
}

.table-price {
    font-weight: 900;
    color: #157B6E;
    font-size: 1rem;
    font-family: 'Montserrat', sans-serif;
    white-space: nowrap;
}

.btn-orange-sm {
    background: #EF6733;
    color: white !important;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 800;
    text-decoration: none;
    text-transform: uppercase;
    display: inline-block;
    border: none;
    transition: all 0.2s;
}

@media (max-width: 768px) {
    .comparison-table-v3 tr {
        padding: 12px 10px;
        display: flex !important;
        flex-wrap: wrap;
        align-items: center;
        border-bottom: 1px solid #edf2ed;
    }
    
    .comparison-table-v3 td {
        padding: 0 !important;
        border: none !important;
    }

    /* Prima colonna (Prodotto) occupa tutto il top */
    .comparison-table-v3 td:nth-child(1) {
        width: 100% !important;
        margin-bottom: 8px;
    }
    
    /* Prezzo e Bottone affiancati */
    .comparison-table-v3 td:nth-child(2) {
        width: 50% !important;
        display: block !important;
    }
    
    .comparison-table-v3 td:nth-child(3) {
        width: 50% !important;
        display: block !important;
        text-align: right !important;
    }

    .table-price {
        font-size: 0.9rem !important;
    }

    .btn-orange-sm {
        padding: 4px 12px;
        font-size: 0.65rem;
    }

    .product-name-toc {
        font-size: 0.78rem !important;
    }
}

/* SEO Assistant */
.seo-checklist div {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.seo-checklist div:last-child {
    border-bottom: none;
}

.seo-checklist i {
    font-size: 1.1rem;
}

.admin-card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

footer {
    background: #212529 !important; /* Grigio scuro (Bootstrap dark) */
    color: #ffffff !important;
    border-top: 1px solid rgba(255,255,255,0.05);
}

footer .text-muted {
    color: rgba(255,255,255,0.6) !important;
}

/* Sidebar Category Items */
.sidebar-category-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.sidebar-category-item:hover {
    background: #f8faf8;
    color: var(--primary);
    border-color: rgba(26, 83, 27, 0.05);
    transform: translateX(5px);
}

.sidebar-category-item i {
    width: 24px;
    font-size: 0.9rem;
    color: #adb5bd;
    transition: all 0.2s ease;
}

.sidebar-category-item:hover i {
    color: var(--primary);
    transform: scale(1.1);
}
.author-box {
    position: relative;
    background: #fcfdfc;
    border-radius: 24px;
    padding: 35px;
    margin-top: 4rem;
    border: 1px solid rgba(26, 83, 27, 0.08);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.author-box:hover {
    background: #ffffff;
    box-shadow: 0 20px 50px rgba(26, 83, 27, 0.08);
    transform: translateY(-4px);
}

.author-box__avatar {
    border: 4px solid #fff;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    transition: all 0.4s ease;
    flex-shrink: 0;
}

.author-box:hover .author-box__avatar {
    transform: scale(1.08) rotate(3deg);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.author-box__name {
    color: #157B6E;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.3rem;
}

.author-box__role {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 12px;
}

.author-box__bio {
    font-size: 0.92rem;
    color: #4a5568;
    line-height: 1.7;
}

.author-box__verified {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    border: 1px solid #c8e6c9;
}

.author-box__social .social-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f8faf8;
    border: 1px solid #edf2ed;
    transition: all 0.3s ease;
}

.author-box__social .social-icon:hover {
    background: var(--primary);
    color: white !important;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(21, 123, 110, 0.2);
}

.author-box__social .social-icon.linkedin:hover { background: #0077b5; }
.author-box__social .social-icon.instagram:hover { background: #e4405f; }

@media (max-width: 576px) {
    .author-box {
        padding: 25px 20px;
        text-align: center;
    }
    .author-box .d-flex {
        flex-direction: column !important;
    }
    .author-box__avatar {
        margin-bottom: 20px;
    }
    .author-box__name {
        justify-content: center;
    }
    .author-box__social {
        justify-content: center;
    }
}

.social-icon {
    transition: all 0.3s ease;
    opacity: 0.7;
}

.social-icon:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.social-icon.linkedin:hover { color: #0077b5 !important; }
.social-icon.instagram:hover { color: #e4405f !important; }

@media (max-width: 768px) {
    .author-box {
        padding: 30px 20px;
        text-align: center;
    }

    .author-box .d-flex {
        flex-direction: column !important;
        gap: 20px !important;
    }

    .author-box__avatar {
        width: 100px !important;
        height: 100px !important;
        margin: 0 auto;
    }

    .author-box__name {
        font-size: 1.2rem;
    }

    .author-box .d-flex.align-items-center.gap-2 {
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* Real-time Search Styles */
.search-nav-container {
    position: relative;
    width: 280px;
}

.search-section-title {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 10px 15px 5px;
    letter-spacing: 0.5px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 15px;
    text-decoration: none;
    color: var(--text-main);
    transition: background 0.2s;
}

.search-result-item:hover {
    background: #f8faf8;
    color: var(--primary);
}

.search-result-img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: contain;
    background: #fcfcfc;
    border: 1px solid #eee;
    flex-shrink: 0;
}

.search-result-info {
    overflow: hidden;
}

.search-result-name {
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.search-result-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Quick Nav Header */
.quick-nav-header h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.category-section {
    padding: 30px 0 50px 0;
    background: linear-gradient(180deg, #ffffff 0%, #f8faf8 100%);
    border-bottom: 1px solid rgba(26, 83, 27, 0.05);
}

/* Header V2 Styling */
.main-header {
    z-index: 1060;
}

.search-nav-container-v2 {
    width: 450px;
    max-width: 100%;
}

.search-group-modern {
    background: #f8f9fa;
    transition: all 0.3s ease;
    border: 1px solid #eee;
}

.search-group-modern:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(21, 123, 110, 0.1) !important;
}

.search-group-modern input:focus {
    box-shadow: none;
    background: white;
}

.category-nav-v2 .nav-link {
    color: #444;
    font-size: 0.75rem;
    padding: 10px 18px !important;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
}

.category-nav-v2 .nav-link i {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #005f56 0%, #4caf50 100%); /* Verde Petrolio -> Verde Chiaro */
    color: white !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: 10px !important;
    font-size: 0.85rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 10px rgba(0, 95, 86, 0.15);
}

.category-nav-v2 .nav-link:hover i {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 6px 15px rgba(0, 95, 86, 0.25);
}

.category-nav-v2 .nav-link:hover {
    color: var(--primary);
    background: #f8faf8;
}

.category-nav-v2 .nav-link.active i {
    background: linear-gradient(135deg, #EF6733 0%, #ff8a65 100%); /* Arancio per l'attivo */
    box-shadow: 0 4px 12px rgba(239, 103, 51, 0.2);
}

.category-nav-v2 .nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

@media (max-width: 991px) {
    .search-nav-container-v2 {
        width: 100%;
        order: 3;
        margin-top: 15px;
    }
    .header-top .container {
        flex-wrap: wrap;
    }
    .category-nav-v2 {
        flex-direction: column;
        align-items: flex-start;
    }
    .category-nav-v2 .nav-link {
        width: 100%;
        padding: 12px 20px !important;
        border-bottom: none;
        border-left: 3px solid transparent;
    }
    .category-nav-v2 .nav-link.active {
        border-left-color: var(--primary);
        background: #f8faf8;
    }
    .post-meta-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .post-meta-info {
        gap: 12px;
        width: 100%;
        justify-content: flex-start;
    }
}

/* Newsletter Footer Form */
.newsletter-footer-section {
    position: relative;
    overflow: hidden;
}

#newsletterForm .form-control:focus {
    background: rgba(255,255,255,0.05) !important;
    border-color: var(--primary) !important;
    box-shadow: none;
    color: white !important;
}

#newsletterForm .btn-success {
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

#newsletterForm .btn-success:hover {
    transform: translateX(3px);
    box-shadow: 0 0 15px rgba(21, 123, 110, 0.4);
}

/* Newsletter In-Post Box */
.newsletter-in-post {
    background: linear-gradient(135deg, #f0f7f4 0%, #ffffff 100%);
    border: 2px solid var(--primary);
    border-radius: 24px;
    padding: 30px;
    margin: 40px 0;
    position: relative;
    overflow: hidden;
}

.newsletter-in-post::before {
    content: "\f1b0";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    bottom: -10px;
    right: 20px;
    font-size: 5rem;
    color: var(--primary);
    opacity: 0.05;
    transform: rotate(-15deg);
}

.newsletter-in-post h4 {
    color: var(--primary);
    font-weight: 800;
}

#newsletterFormInPost .form-control {
    border-radius: 50px 0 0 50px;
    padding-left: 25px;
}

#newsletterFormInPost .btn {
    border-radius: 0 50px 50px 0;
    padding-right: 25px;
    padding-left: 25px;
}

.footer-links {
    font-size: 0.78rem;
}

.footer-links a, 
.footer-links span {
    color: #ffffff !important;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.footer-links a:hover {
    opacity: 1;
}

.hover-white:hover {
    opacity: 1 !important;
}

.search-result-item.active {
    background: #f0f7f4;
    color: var(--primary);
}

/* Search Loader */
.search-loader {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(21, 123, 110, 0.1);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
