/* ============================================
   RESPONSIVE STYLES
   ============================================ */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 0 20px;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .hero-slide h1 {
        font-size: 1.6em;
        /* Updated from legacy */
    }

    .section-title {
        font-size: 1.7em;
    }
}

/* Mobile (< 768px) */
@media (max-width: 768px) {

    /* Header */
    .top-header {
        display: none;

    }

    .top-header .container {
        flex-direction: column;
        gap: 10px;
        text-align: center;


    }

    /* --- BURGER MENU ALIGNMENT (C'est ici pour le pousser a droite) --- */
    .main-header .container {
        justify-content: space-between;
        /* Ensure burger is on right */
        padding-right: 0px !important;
        /* Force right edge */
        width: 100%;
        align-items: center;
        display: flex;
        margin-top: -1.6rem;


    }

    .company-info {
        flex-direction: column;
        gap: 5px;
    }

    /* Navigation */
    .menu-toggle {
        display: block;
        margin-left: auto;
    }

    .nav-menu {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: -100%;
        /* Hidden off-left */
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: #ffffff;
        /* White background */
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
        z-index: 1001;
        /* Above header */
        padding-top: 0;
        transition: left 0.3s ease;
        overflow-y: auto;
        /* Enable vertical scroll */
        -webkit-overflow-scrolling: touch;
    }

    .mobile-nav-header {
        display: flex;
        flex-direction: column;
        /* Stacked layout */
        padding: 20px;
        /* background-color: #f8f9fa; */
        /* border-bottom: 1px solid #eee; */
        gap: 10px;
    }

    .mobile-nav-top {
        display: flex;
        justify-content: space-between;
        /* align-items: center; */
        width: 100%;
        margin-top: -1rem;
        margin-right: 4rem;


    }

    .mobile-logo {
        height: 20px;

    }

    .mobile-nav-details {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .mobile-nav-details .licensed-badge {
        font-size: 0.70em;
        white-space: nowrap;
        background-color: #ffcc00;
        color: #000;
        padding: 3px 10px;
        border-radius: 20px;
        font-weight: 700;

    }

    .email-link-mobile {
        font-size: 0.85em;
        color: var(--primary-color);
        text-decoration: underline;

    }

    .menu-close {
        background: none;
        border: none;
        font-size: 0.8rem;
        /* Even smaller */
        color: var(--secondary-color);
        cursor: pointer;
        /* padding: 10px; */
        /* Bigger touch target, but visual icon small */
        margin-left: 6rem;

    }

    /* Mobile Nav Actions (Footer of nav) */
    .mobile-nav-actions {
        margin-top: auto;
        font-size: 0.8rem;
        /* Push to bottom */
        /* padding: 20px; */
        border-top: 1px solid #eee;
        display: flex;
        /* flex-direction: column; */
        gap: 14px;
    }

    .mobile-nav-actions .nav-link {
        /* Specificity for actions */
        padding: 10px 0;
        color: var(--secondary-color);
        border-bottom: none;

    }

    .mobile-nav-actions .nav-link i {
        font-size: 1.2em;
        color: var(--primary-color);

    }

    .nav-menu.active {
        left: 0;
    }

    .nav-item.search-container {
        padding: 15px 20px;
        order: -1;
        border-bottom: 2px solid #eee;
        background: #f8f9fa;
    }

    .search-box {
        width: 100%;
        background: #fff;
    }

    .search-input {
        width: 100%;
    }

    .nav-link {
        padding: 15px 20px;
        color: var(--secondary-color) !important;
        /* Force Blue text */
        font-weight: 600;
        border-bottom: none;
        display: flex;
        justify-content: flex-start;
        /* Aligne à gauche */
        align-items: center;
        text-align: left;
        width: 100%;
    }

    /* Trait en bas sur chaque lien principal du menu mobile */
    .mobile-nav-link-item {
        border-bottom: 1px solid #e5e7eb;
        justify-content: flex-start;
        align-items: left;
        width: 100%;
    }

    .mobile-nav-link-item .nav-link.active {
        color: var(--primary-color) !important;
    }

    /* Add overlay when menu is open */
    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        display: none;
    }

    .nav-overlay.active {
        display: block;
    }

    /* Hero Slider Responsive Overrides */
    .hero-slider {
        min-height: auto;
        /* Allow content to dictate */
        padding: 10px 0;
    }

    .hero-slide {
        padding: 20px 0;
        height: 60vh;
    }

    .hero-slide .container {
        display: flex;
        flex-direction: column;
        /* text-align: center; */
        /* gap: 20px; */
    }

    .hero-slide-content {
        /* order: 1; */
        /* width: 100%; */
        display: flex;
        flex-direction: column;

        /* align-items: center;
        text-align: center; */
    }

    .hero-slide-image {
        display: none;
        /* Masquer l'image du slider sur mobile */
    }

    .hero-slide-image img {
        max-width: 200px;
        /* Slightly larger for better detail */
        max-height: 130px;
    }

    .hero-slide h1 {
        font-size: 1.35em !important;
        margin-bottom: 12px !important;
    }

    .hero-slide p {
        font-size: 0.9em !important;
        margin: 0 auto 15px !important;
        max-width: 90%;
    }

    .cta-buttons {
        flex-direction: row;
        /* Keep buttons side-by-side if small */
        justify-content: center;
        gap: 10px;
        width: 90%;

    }

    .cta-buttonss {
        flex-direction: row;
        /* Keep buttons side-by-side if small */
        justify-content: center;
        gap: 10px;
        width: 80%;

    }

    .cta-buttonss .btn {
        padding: 8px 15px;
        font-size: 0.85em;
        flex: 1;
        margin-top: 10px;
        /* width: 100%; */
        justify-content: center;
        align-items: center;
        display: flex;
        text-align: center;

        /* Equal width */
    }

    hero-subtitle-tag .hero-slide-content .hero-subtitle-tag {
        width: 80%;
        margin-bottom: 1rem;
    }

    .cta-buttons .btn {
        padding: 8px 15px;
        font-size: 0.85em;
        flex: 1;
        margin-top: 10px;
        /* width: 100%; */
        justify-content: center;
        align-items: center;
        display: flex;
        text-align: center;

        /* Equal width */
    }

    /* Products */
    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .section-title {
        font-size: 1.5em;
    }

    .product-actions {
        flex-direction: column;
    }

    /* Product Cards (Horizontal to Vertical on Mobile) */
    .product-card.horizontal {
        height: auto !important;
        /* Fix fixed height */
    }

    .product-card-body {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 20px;
    }

    .product-image-side {
        flex: 0 0 auto;
        border-right: none;
        border-bottom: 1px solid #eee;
        padding: 0 0 15px 0;
        margin-bottom: 15px;
        width: 100%;
    }

    .product-info-side {
        padding: 0;
        width: 100%;
    }



    /* Duo & Enterprise Sections */
    .products-duo {
        flex-direction: column;
        gap: 20px;
    }

    .product-inner,
    .product-inner.reverse {
        flex-direction: column-reverse;
        align-items: center;
        text-align: center;
        gap: 15px;
    }

    .product-image-side,
    .product-inner.reverse .product-image-side {
        border: none;
        flex: 0 0 auto;
        width: 100%;
        padding: 10px 0;
    }

    .product-info-side {
        padding-bottom: 10px;
        width: 100%;
    }

    .products-horizontal-card {
        flex-direction: column;
        height: auto;
    }

    /* Detail Pages */
    .product-detail-flex {
        flex-direction: column;
        gap: 30px;
        text-align: center;
    }

    .product-detail-image {
        flex: 0 0 auto;
        width: 180px;
        margin: 0 auto;
    }

    .product-detail-compat {
        justify-content: center;
        margin: 0 auto 20px;
    }

    /* Testimonials */
    .testimonials-slider {
        height: auto;
        min-height: 250px;
    }

    .testimonial {
        padding: 20px;
    }

    /* Footer */
    .footer-top {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* Small Mobile (< 480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .hero-slide h1 {
        font-size: 1.2em !important;
    }

    .hero-slide p {
        font-size: 0.85em !important;
    }

    .hero-slide-image img {
        max-width: 150px;
        max-height: 110px;
        display: none;
    }

    .section-title {
        font-size: 1.35em;
        padding: 0 10px;
    }

    .btn {
        padding: 8px 16px;
        font-size: 0.85em;
    }

    .product-title {
        font-size: 1.05em;
    }

    .cta-buttons {
        flex-direction: column;
        display: flex;
        width: 100%;
        /* margin: 0 auto; */
        /* Stack on very small screens */
    }
}

/* Mobile Dropdown Overrides (Global for mobile) */
@media (max-width: 768px) {
    .nav-item.dropdown .dropdown-menu {
        position: static;
        display: none;
        width: 100%;
        min-width: unset;
        box-shadow: none;
        padding: 10px 0 10px 15px;
        background-color: #fcfcfc;
        /* Slight background change to differentiate */
        visibility: visible;
        opacity: 1;
        transform: none;
        border: none;
        border-left: 3px solid var(--primary-color);
        /* Visual cue */
        margin-top: 5px;
        margin-left: 10px;
    }

    .nav-item.dropdown.active .dropdown-menu {
        display: block !important;
        /* Force display */
    }

    .arrow {
        display: inline-block;
        transition: transform 0.3s ease;
        margin-left: 5px;
    }

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

    .dropdown-grid,
    .dropdown-grid-2x2-modern {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .dropdown-column {
        min-width: unset;
    }

    .dropdown-item {
        padding: 5px 0;
        border-bottom: 1px dashed #eee;
        display: block;
        /* Ensure it's a block */
        text-decoration: none;
    }

    .dropdown-item strong {
        color: #333 !important;
        /* Force visibility */
        display: block;
        font-weight: 700;
        line-height: 1.2;
    }

    .dropdown-item p {
        color: #666 !important;
        /* Force visibility */
        display: block;
        font-size: 0.85em;
        line-height: 1.3;
        margin-top: 2px;
    }

    .dropdown-column h4 {
        color: var(--secondary-color) !important;
        font-size: 0.95em;
        margin: 10px 0 5px 0;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        display: block;
        border-bottom: 2px solid var(--primary-color);
        padding-bottom: 3px;
        width: max-content;
    }

    .dropdown-item:last-child {
        border-bottom: none;
    }

    .dropdown-item .item-icon {
        display: none;
        /* Simplify mobile view, remove icons if too cluttered, or keep? User didn't specify. I'll keep text. */
    }
}