/* ============================================================
   HOME PAGE — MOBILE OPTIMIZATIONS
   Target: page--home (welcome.blade.php)
   Strategy: mobile-first corrections + progressive enhancement
   ============================================================ */

/* ── 1. CONTAINER: add horizontal padding on all screens ── */
.page--home .container,
.footer .container,
.page--home .nav-container {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

/* ── MOBILE LOGO: affiancato e più compatto ── */
.mobile-logo__brand {
    display: inline-flex;
    align-items: baseline;
    gap: 0.2rem;
    line-height: 1;
}

.mobile-logo__bold {
    font-weight: 900;
    color: var(--primary, #e02020);
    font-size: 1rem;
    letter-spacing: -0.3px;
}

.mobile-logo__light {
    font-weight: 400;
    color: #111;
    font-size: 1rem;
}

/* ── 2. SECTION: reduce vertical padding on mobile ── */
@media (max-width: 767px) {
    .section {
        padding: 2.5rem 0;
    }

    .section-header {
        margin-bottom: 2rem;
    }

    .section-title {
        font-size: clamp(1.6rem, 5.5vw, 2.5rem);
    }

    .section-subtitle {
        font-size: 0.95rem;
    }
}

/* ── 3. HERO: padding, typography, layout fixes ── */
@media (max-width: 767px) {
    section.hero {
        min-height: 100svh; /* safe viewport height on mobile */
        align-items: flex-start;
        padding-top: 2.5rem;
        padding-bottom: 2.5rem;
    }

    .hero-content {
        padding: 0 1.25rem 2rem;
        max-width: 100%;
    }

    .hero h1 {
        font-size: clamp(2rem, 8vw, 3rem);
        letter-spacing: -1px;      /* meno compresso su schermi piccoli */
        line-height: 1.15;
        margin-bottom: 1rem;
    }

    .hero p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
        max-width: 100%;
    }

    .hero-badge {
        font-size: 0.72rem;
        margin-top: 0.5rem;
        margin-bottom: 1rem;
    }

    /* Hero buttons: full-width stack on very small screens */
    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        margin-top: 1.75rem;
        margin-bottom: 2rem;
    }

    .hero-buttons .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .btn-large,
    .hero-cta {
        padding: 0.9rem 1.5rem;
        font-size: 1rem;
    }

    /* Hero stats: compact row */
    .hero-stats {
        gap: 0.75rem;
        flex-wrap: wrap;
    }

    .hero-stat strong {
        font-size: 1.35rem;
    }

    .hero-stat span {
        font-size: 0.7rem;
    }

    .hero-stat-divider {
        height: 30px;
    }

    /* Nascondi le statistiche hero su mobile: risparmia spazio */
    .hero-stats {
        display: none;
    }
}

/* ── 4. CATEGORIES GRID: 1-col on mobile, 2-col on tablet+ ── */
@media (min-width: 540px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 539px) {
    .category-card {
        padding: 1.1rem;
        gap: 0.9rem;
    }

    .category-icon {
        width: 48px;
        height: 48px;
        flex-shrink: 0;
    }

    .category-body h3 {
        font-size: 0.9rem;
    }

    .category-body p {
        font-size: 0.8rem;
    }
}

/* ── 5. ABOUT SECTION: fix floating cards on mobile ── */
@media (max-width: 767px) {
    .about-grid {
        gap: 2rem;
    }

    span.hero-highlight {
        padding-left: 8px;
    }

    /* Disabilita il posizionamento assoluto delle card floating su mobile */
    .about-visual {
        min-height: unset;
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .about-card-secondary {
        position: static; /* rimuove l'absoluto che causa overflow */
        width: 100%;
    }

    .ac1,
    .ac2 {
        top: auto;
        bottom: auto;
        right: auto;
        left: auto;
    }

    /* Layout orizzontale compatto per le due card secondary */
    .about-visual-cards-row {
        display: flex;
        gap: 0.75rem;
    }

    .about-card-main {
        padding: 2rem 1.5rem;
        border-radius: 16px;
    }

    .about-number {
        font-size: 3.5rem;
        letter-spacing: -2px;
    }

    .about-number-label {
        font-size: 0.95rem;
    }

    .about-card-secondary {
        flex: 1;
        padding: 1rem 1.1rem;
    }

    .about-card-secondary strong {
        font-size: 1.2rem;
    }

    .about-card-secondary span {
        font-size: 0.75rem;
    }

    .about-content .about-lead {
        font-size: 1rem;
    }
}

/* About: 2 columns on desktop */
@media (min-width: 1024px) {
    .about-grid {
        grid-template-columns: 1fr 1fr;
        gap: 5rem;
    }

    .about-visual {
        min-height: 420px;
    }

    /* Ripristina il layout originale con posizionamento assoluto */
    .about-visual-cards-row {
        display: contents; /* trasparente: le card tornano figli diretti di about-visual */
    }

    .about-card-secondary {
        position: absolute;
    }
}

/* ── 6. SERVICES GRID: 2-col on tablet, 4-col on desktop ── */
@media (min-width: 540px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 767px) {
    /* Grid 2 colonne: icona sx centrata | titolo+descrizione dx */
    .service-card {
        display: grid;
        grid-template-columns: 52px 1fr;
        grid-template-rows: auto auto;
        column-gap: 1rem;
        row-gap: 0.2rem;
        padding: 1.25rem;
        align-items: center; /* centra verticalmente l'intera riga */
    }

    /* Icona: colonna 1, span su entrambe le righe, centrata */
    .service-icon {
        grid-column: 1;
        grid-row: 1 / 3;
        align-self: center;
        margin-bottom: 0;
        width: 52px;
        height: 52px;
    }

    /* Titolo: colonna 2, riga 1 */
    .service-card h3 {
        grid-column: 2;
        grid-row: 1;
        align-self: end;
        margin-bottom: 0;
    }

    /* Descrizione: colonna 2, riga 2 */
    .service-card p {
        grid-column: 2;
        grid-row: 2;
        align-self: start;
        font-size: 0.82rem;
        margin: 0;
    }
}

/* ── 7. TESTIMONIALS GRID: 1-col mobile, 3-col desktop ── */
@media (min-width: 768px) {
    .testimonials-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .testimonial-card {
        padding: 1.5rem;
    }

    /* Mostra solo la testimonial in evidenza su mobile molto piccolo */
    .testimonial-card:not(.tc-featured) {
        display: flex; /* mantieni visibili */
    }
}

/* ── 8. CTA SECTION: padding e layout mobile ── */
@media (max-width: 767px) {
    .cta-card {
        padding: 1.75rem 1.25rem;
        border-radius: 16px;
    }

    .cta-card h2 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .cta-actions {
        width: 100%;
    }

    .cta-actions .btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .cta-info-item {
        font-size: 0.82rem;
        align-items: flex-start;
    }
}

@media (min-width: 768px) {
    .cta-card {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .cta-content {
        flex: 1;
    }

    .cta-actions {
        flex-shrink: 0;
    }
}

/* ── 9. FOOTER GRID: layout riorganizzato su mobile ── */

/* Mobile: 2 colonne — about full-width, links affiancati, contact full-width */
@media (max-width: 767px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.75rem 1.5rem;
        padding-bottom: 2rem;
    }

    /* Footer about: occupa tutta la larghezza */
    .footer-about {
        grid-column: 1 / -1;
    }

    /* Footer contact: occupa tutta la larghezza */
    .footer-contact {
        grid-column: 1 / -1;
    }

    /* Intestazioni sezioni footer: più compatte */
    .footer h4 {
        font-size: 0.8rem;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        margin-bottom: 0.75rem;
    }

    /* Voci li: spaziatura ridotta */
    .footer li {
        margin-bottom: 0.4rem;
        font-size: 0.82rem;
    }

    /* Footer-contact: visualizza items in colonna con icone */
    .footer-contact ul {
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
    }

    /* Descrizione about: testo più compatto */
    .footer-about p {
        font-size: 0.82rem;
        line-height: 1.55;
    }
}

/* Tablet: 4 colonne (desktop) */
@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1.5fr;
        gap: 3rem;
    }
}

@media (max-width: 539px) {
    .footer {
        padding: 2.5rem 0 0;
    }

    .footer-grid {
        gap: 2rem;
        padding-bottom: 2rem;
    }
}

/* Logo footer: tutto su un'unica riga (tutti i mobile) */
@media (max-width: 767px) {
    .footer .logo {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        white-space: nowrap;
        align-items: baseline;
        gap: 0.3rem;
        font-size: 1.15rem;
    }

    .footer .logo-bold,
    .footer .logo-light {
        display: inline;
        white-space: nowrap;
    }
}

/* ── 10. MAIN CONTENT: corregge il padding-top per la home su mobile ── */
@media (max-width: 767px) {
    .page--home main,
    .page--prodotti main {
        padding-top: 0;
    }

    section.hero {
        margin-top: 0;
    }
}

/* ── 11. HERO VEHICLE SELECTOR (Livewire): mobile layout ── */
@media (max-width: 767px) {
    .hero-container-text {
        width: 100%;
    }

    /* Vehicle selector form buttons — full width on mobile */
    .vehicle-selector,
    [wire\:id] form {
        width: 100%;
    }
}

/* ── 12. PARTICLE BLOBS: ridotte su mobile per performance ── */
@media (max-width: 767px) {
    .p1 {
        width: 200px;
        height: 200px;
        top: -60px;
        right: -40px;
    }

    .p2 {
        width: 100px;
        height: 100px;
    }

    .p3 {
        display: none; /* rimuovi particella centrale su mobile */
    }
}

/* ── 13. NAVBAR CONTAINER: padding su mobile ── */
@media (max-width: 767px) {
    .nav-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ── 14. TEXT READABILITY: evita overflow di testi su mobile ── */
@media (max-width: 767px) {
    .hero h1 br {
        display: none; /* rimuovi i <br> manuali sull'h1: il testo va a capo naturalmente */
    }
}

/* ── 15. HEADER__NAVBAR + MEGAMENU: allineamento sinistra su mobile ── */
@media (max-width: 767px) {
    /* Megamenu area */
    .header__megamenu-area,
    .megamenu-area {
        justify-content: flex-start !important;
        align-items: flex-start !important;
        text-align: left;
    }

    /* Navbar principale */
    .header__navbar {
        justify-content: flex-start !important;
        text-align: left;
    }

    .header__navbar-departments,
    .header__navbar-menu {
        justify-content: flex-start !important;
    }

    .main-menu__list {
        justify-content: flex-start !important;
    }

    .departments__button {
        margin-left: 0 !important;
    }
}

/* ── HEADER DESKTOP: nascosto su mobile (usa site__mobile-header) ── */
@media (max-width: 991px) {
    .site__header {
        display: none !important;
    }
}


/* ══════════════════════════════════════════════════════
   MOBILE MENU — DESIGN PREMIUM
   ══════════════════════════════════════════════════════ */

/* ── Drawer: larghezza e sfondo ── */
.mobile-menu__body {
    width: 100% !important;
    max-width: 100%;
    background: #ffffff;
    box-shadow: 4px 0 32px rgba(0,0,0,0.18);
}

/* ── Header barra "Menu" — sfondo scuro premium ── */
.mobile-menu__panel-header {
    height: 56px;
    background: #111;
    border-bottom: none;
    display: flex;
    align-items: center;
    padding: 0 1rem;
}

.mobile-menu__panel-title {
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin: auto;
}

/* Chiudi (X): su sfondo scuro */
.mobile-menu__close {
    background: transparent;
    color: rgba(255,255,255,0.5);
    top: 4px;
}
.mobile-menu__close:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

/* ── Barra settings (lingua/valuta): compatta e ordinata ── */
.mobile-menu__settings-list {
    background: #f8f8f8;
    border-bottom: 1px solid #ebebeb;
}

.mobile-menu__setting-button {
    padding: 0.7rem 1.1rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #555;
    gap: 0.4rem;
}

.mobile-menu__setting-icon {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8e8e8;
    color: #444;
}

.mobile-menu__setting-icon--currency {
    background: #1a1a2e;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
}

.mobile-menu__setting-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
}

.mobile-menu__setting-arrow {
    color: #bbb;
    font-size: 0.6rem;
    right: 10px;
}

/* ── Icon bar (Wishlist / Confronta / Account / Carrello) ── */
.mobile-menu__divider {
    height: 1px;
    background: #ebebeb;
}

.mobile-menu__indicators {
    display: flex;
    padding: 0;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-menu__indicator {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 0.4rem 0.75rem;
    gap: 0.35rem;
    color: #444;
    text-decoration: none;
    border-right: 1px solid #f0f0f0;
    transition: background 0.15s, color 0.15s;
    position: relative;
}

.mobile-menu__indicator:last-child {
    border-right: none;
}

.mobile-menu__indicator:hover,
.mobile-menu__indicator:active {
    background: #fef2f2;
    color: #dc2626;
}

.mobile-menu__indicator-icon {
    position: relative;
    font-size: 1.1rem;
    line-height: 1;
    color: inherit;
}
.mobile-menu__links a{
    padding-left: 1rem !important;
}
.mobile-menu__indicator-title {
    display: block !important;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #999;
    margin-top: 0;
}

.mobile-menu__indicator:hover .mobile-menu__indicator-title {
    color: #dc2626;
}

/* Badge contatore (carrello/wishlist) */
.mobile-menu__indicator-counter {
    position: absolute;
    top: -4px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    font-size: 0.6rem;
    font-weight: 800;
    border-radius: 99px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.mobile-menu__indicator-counter::before {
    border-radius: 99px !important;
    transform: none !important;
    skewX: 0 !important;
}

/* ── Navigation Links ── */
.mobile-menu a,
.mobile-menu__links a,
.mobile-menu__links li {
    display: block;
    width: 100%;
}

.mobile-menu__links ul {
    list-style: none;
    padding: 0.4rem 0;
    margin: 0;
}

.mobile-menu__links li + li {
    border-top: 1px solid #f5f5f5;
}

/* Link premium — 3 zone allineate */
.mmlink {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
    width: 100% !important;
    padding: 0.9rem 1.1rem 0.9rem 1rem;
    color: #1a1a1a;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background 0.15s, border-color 0.15s;
    position: relative;
    min-height: 52px;
}

.mmlink:hover,
.mmlink:active {
    background: #fef2f2;
    border-left-color: #dc2626;
    color: #dc2626;
    text-decoration: none;
}

/* Icona: chip solido con colore brand */
.mmlink__icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #dc2626;
    border-radius: 8px;
    color: #fff;
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.15s;
    box-shadow: 0 2px 6px rgba(220,38,38,0.25);
}

.mmlink:hover .mmlink__icon {
    background: #b91c1c;
    transform: scale(1.05);
}

/* Label */
.mmlink__label {
    flex: 1;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.005em;
    line-height: 1.2;
    color: inherit;
    padding-left: 0.5rem;
}

/* Freccia */
.mmlink__arrow {
    font-size: 0.6rem;
    color: #d1d5db;
    flex-shrink: 0;
    transition: transform 0.15s, color 0.15s;
}

.mmlink:hover .mmlink__arrow {
    transform: translateX(3px);
    color: #dc2626;
}

/* ── Numero telefono in fondo ── */
.mobile-menu__contacts {
    text-align: center;
    padding: 1rem 1.25rem;
    background: #f8f8f8;
    border-top: 1px solid #ebebeb;
    transition: background 0.15s;
}

.mobile-menu__contacts:hover {
    background: #f0f0f0;
}

.mobile-menu__contacts-subtitle {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #999;
    margin-bottom: 0.2rem;
}

.mobile-menu__contacts-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #dc2626;
    letter-spacing: -0.3px;
}

/* ── Pannello ricerca mobile: drop-down SOTTO la navbar (anziché overlay sopra) ── */
@media (max-width: 767.98px) {
    .mobile-header__search {
        position: absolute;
        top: 100%;              /* subito sotto la mobile-header (50px) */
        left: 0;
        right: 0;
        width: 100%;
        max-width: none;
        height: 56px;
        padding: 0;
        margin: 0;
        z-index: 99;
        background: #fff;
        box-shadow: 0 6px 12px -4px rgba(0, 0, 0, .12);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s;
        pointer-events: none;
    }

    .mobile-header__search--open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        border-top:1px solid #ddd;
        transition: opacity .22s ease, transform .22s ease, visibility 0s linear 0s;
        pointer-events: auto;
    }

    /* Dropdown suggerimenti istantanei mobile */
    .mobile-search__suggestions {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        max-height: calc(100vh - 110px);
        overflow-y: auto;
        box-shadow: 0 8px 16px -4px rgba(0, 0, 0, .15);
        border-top: 1px solid #eee;
        z-index: 100;
        padding: 8px 0;
    }

    .mobile-search__suggestions-loading {
        padding: 14px 16px;
        font-size: 13px;
        color: #666;
        text-align: center;
    }

    .mobile-search__suggestions-title {
        padding: 8px 16px 4px;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: .12em;
        text-transform: uppercase;
        color: #999;
    }

    .mobile-search__suggestions-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 16px;
        color: #262626;
        text-decoration: none;
        border-top:1px dashed #ddd;
        transition: background .15s;
    }

    .mobile-search__suggestions-item:hover,
    .mobile-search__suggestions-item:active {
        background: #f5f5f5;
        color: #262626;
        text-decoration: none;
    }

    .mobile-search__suggestions-thumb {
        width: 44px;
        height: 44px;
        object-fit: cover;
        border-radius: 4px;
        flex-shrink: 0;
        background: #fafafa;
    }

    .mobile-search__suggestions-info {
        flex: 1;
        min-width: 0;
    }

    .mobile-search__suggestions-name {
        font-size: 13px;
        font-weight: 500;
        line-height: 1.3;
        margin-bottom: 2px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .mobile-search__suggestions-price {
        font-size: 13px;
        font-weight: 700;
        color: #e52727;
    }

    .mobile-search__suggestions-link {
        display: block;
        padding: 8px 16px;
        font-size: 14px;
        color: #262626;
        text-decoration: none;
    }

    .mobile-search__suggestions-link:hover,
    .mobile-search__suggestions-link:active {
        background: #f5f5f5;
        color: #262626;
        text-decoration: none;
    }

    .mobile-search__suggestions-empty {
        padding: 16px;
        font-size: 13px;
        color: #888;
        text-align: center;
    }
}
