/* 
   assets/css/responsive.css
   Gestione Responsive per Dispositivi Mobili (<992px)
   Questo file sovrascrive lo stile desktop solo su schermi piccoli.
   Mantiene inalterata l'esperienza Desktop (>992px).
*/

/* Hide hamburger on desktop by default */
.mobile-menu-btn, .mobile-overlay {
    display: none;
}

@media (max-width: 992px) {

    .mobile-overlay {
        display: block;
    }

    /* --- GLOBAL & TYPOGRAPHY --- */
    body {
        font-size: 16px; /* Base font size leggermente più grande per leggibilità */
    }

    h1, .hero-title {
        font-size: 2.2rem !important; /* Riduzione titoli enormi */
    }

    h2, .section-title {
        font-size: 1.8rem !important;
    }

    .container {
        padding: 0 20px; /* Padding laterale standard mobile */
    }

    /* --- HEADER & NAVIGATION --- */
    .main-header {
        height: 70px; /* Header più compatto */
        padding: 0 10px;
    }

    .header-inner {
        position: relative;
        justify-content: space-between;
    }

    .logo-link img, .logo-link svg {
        height: 35px !important;
        width: auto !important;
    }
    
    /* Logo adjustments for SVG inside header */
    .logo-link svg text {
        font-size: 60px; /* Smaller text in SVG */
    }

    .logo-link svg .slogan-text {
        display: none; /* Nascondi slogan su mobile */
    }

    .logo-link svg text:first-child {
        transform: translateY(15px); /* Centra meglio il testo principale senza slogan */
    }

    /* Hamburger Menu Button */
    .mobile-menu-btn {
        display: flex !important; /* Visibile solo su mobile */
        flex-direction: column;
        justify-content: space-between;
        width: 28px;
        height: 18px;
        background: transparent;
        border: none;
        cursor: pointer;
        z-index: 1002;
        padding: 0;
    }

    .mobile-menu-btn span {
        display: block;
        width: 100%;
        height: 2px;
        background-color: var(--text-dark);
        border-radius: 2px;
        transition: all 0.3s ease;
    }

    /* Hamburger Animation State */
    .mobile-menu-btn.open span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .mobile-menu-btn.open span:nth-child(2) {
        opacity: 0;
    }
    .mobile-menu-btn.open span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Mobile Navigation Drawer */
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%; /* Nascosto a destra */
        width: 80%;
        height: 100vh;
        background: white;
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 25px 40px;
        box-shadow: -5px 0 30px rgba(0,0,0,0.1);
        transition: transform 0.3s ease-out; /* Usa transform per fluidità */
        z-index: 1001;
        overflow-y: auto;
        will-change: transform;
        transform: translate3d(0, 0, 0);
    }

    .main-nav.open {
        transform: translate3d(-100%, 0, 0); /* Slide in più fluido */
    }

    .nav-link {
        font-size: 1.1rem;
        font-weight: 700;
        padding: 15px 0;
        width: 100%;
        border-bottom: 1px solid #f8f9fa;
        color: var(--text-dark);
        text-transform: none;
        will-change: opacity;
    }

    .nav-link i {
        width: 25px;
        text-align: center;
    }

    /* Dropdown Mobile - Accordion Style */
    .nav-dropdown {
        width: 100%;
    }
    
    .nav-dropdown .dropdown-menu {
        position: static;
        opacity: 0;
        visibility: hidden;
        max-height: 0;
        transform: none !important; /* Forza rimozione transform desktop */
        box-shadow: none;
        border: none;
        padding: 0; /* Rimuovi padding per allineamento */
        min-width: 100%;
        background: transparent; /* Sfondo trasparente per integrarsi */
        margin: 0;
        overflow: hidden;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .nav-dropdown.active .dropdown-menu {
        opacity: 1;
        visibility: visible;
        max-height: 200px;
        padding-top: 5px;
    }

    .dropdown-item {
        padding: 12px 0 12px 35px !important; /* Allineato con icone sopra */
        font-size: 1rem !important;
        border-radius: 0 !important;
        background: transparent !important;
        border-bottom: 1px solid #f8f9fa;
        width: 100%;
    }

    .dropdown-item i {
        font-size: 1.1rem !important;
        color: var(--text-light);
    }

    .nav-dropdown.active .dropdown-arrow {
        transform: rotate(180deg);
    }

    /* Overlay Sfondo Scuro - Ottimizzato (Rimosso Blur pesante) */
    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1000;
        transition: opacity 0.3s ease;
        opacity: 0;
        visibility: hidden;
        will-change: opacity;
    }

    .mobile-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* --- HOMEPAGE ELEMENTS --- */
    
    /* Services Grid - 2 cols su tablet, 1 col su mobile */
    .services-row-top, .services-row-bottom {
        grid-template-columns: 1fr !important; /* Stack verticale */
        gap: 15px !important;
    }

    .komp-card-rect {
        min-height: 80px;
        padding: 1rem 1.2rem;
    }

    .rect-content h2 {
        font-size: 1.2rem !important;
    }

    /* Info Section & Tools */
    .info-section-grid {
        grid-template-columns: 1fr;
    }

    .tool-links {
        flex-direction: column; /* Link in colonna */
    }

    /* Bento Grid */
    .bento-grid {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto !important;
    }

    .bento-large, .bento-wide {
        grid-column: span 1 !important;
        grid-row: auto !important;
    }

    /* Impact Stats */
    .impact-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .stat-number {
        font-size: 3rem !important;
    }
    
    .impact-points {
        align-items: flex-start; /* Allinea punti a sinistra per leggibilità */
        text-align: left;
        margin-top: 1rem;
    }

    /* --- FILTERS MOBILE COLLAPSIBLE --- */
    .filter-box {
        padding: 0;
        overflow: hidden;
        border: 1px solid var(--border-color);
    }

    .filter-title {
        margin-bottom: 0 !important;
        padding: 1.2rem 1.5rem !important;
        cursor: pointer;
        background: white;
        border-bottom: none !important;
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 1.1rem !important;
    }

    .filter-box .filter-section, 
    .filter-box .filter-divider {
        display: none; /* Nascosti di default */
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .filter-box.open {
        border-color: var(--primary-green);
    }

    .filter-box.open .filter-title {
        background: #f9fbfd;
        border-bottom: 1px solid #eee !important;
        color: var(--primary-green);
    }

    .filter-box.open .filter-title i {
        transform: rotate(180deg);
    }

    .filter-box.open .filter-section, 
    .filter-box.open .filter-divider {
        display: block; /* Mostra quando aperto */
    }

    .filter-box.open .filter-section:last-child {
        padding-bottom: 1.5rem;
    }

    /* --- OFFER CARD COMPACT MOBILE --- */
    .offer-card-row {
        margin-bottom: 15px;
        border-radius: 10px;
    }

    .offer-row-body {
        flex-direction: column;
        padding: 1.2rem 0.8rem !important; /* Più compatto */
        gap: 12px !important;
        text-align: center;
    }

    .col-brand {
        gap: 5px !important;
    }

    .brand-logo {
        max-height: 24px !important; /* Logo più piccolo */
    }

    .brand-title {
        font-size: 1rem !important;
    }

    .col-features {
        border-left: none;
        border-right: none;
        border-top: 1px solid #f0f0f0;
        border-bottom: 1px solid #f0f0f0;
        padding: 10px 0 !important;
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, 1fr); 
        gap: 5px;
        margin: 5px 0 !important;
    }

    .feat-box i {
        font-size: 0.9rem !important;
    }

    .feat-val {
        font-size: 0.85rem !important;
    }

    .feat-lbl {
        font-size: 0.55rem !important;
    }

    .col-price {
        width: 100%;
        align-items: center;
        gap: 5px !important;
    }

    .price-int {
        font-size: 2.2rem !important; /* Prezzo più piccolo */
    }

    .price-dec {
        font-size: 0.8rem !important;
    }

    .price-per {
        font-size: 0.45rem !important;
    }

    .btn-attiva, .btn-richiama {
        width: 100%;
        max-width: 100% !important; 
        padding: 10px !important;
        font-size: 0.8rem !important;
    }

    .offer-row-footer {
        padding: 8px 10px !important;
        gap: 8px !important;
        justify-content: center;
    }

    .pill-base {
        font-size: 0.65rem !important;
        padding: 3px 8px !important;
    }

    /* --- BREADCRUMBS MOBILE --- */
    .custom-breadcrumb {
        justify-content: center;
        font-size: 0.8rem !important;
        margin-bottom: 0.8rem !important;
        gap: 5px !important;
    }

    .custom-breadcrumb i {
        font-size: 0.6rem !important;
    }

    /* Footer Mobile */
    .footer-grid, .footer-grid-new {
        grid-template-columns: 1fr !important; /* Stack verticale */
        gap: 30px;
        text-align: center;
    }

    .footer-bottom-inner {
        grid-template-columns: 1fr;
        flex-direction: column;
        gap: 20px;
    }
    
    .footer-center {
        flex-direction: column;
    }

}
