/* ==========================================================================
   mobile.css — Responsive overrides for evolution-VoIP
   Loaded after style.css on all French pages.
   Breakpoints:
     1024px  Tablet / small laptop
      768px  Mobile landscape / large phone
      480px  Mobile portrait
   ========================================================================== */

/* ==========================================================================
   HAMBURGER BUTTON — hidden on desktop, shown via media query below
   ========================================================================== */
.nav-hamburger {
    display: none;
}

/* ==========================================================================
   GLOBAL SLIDESHOW FIX — .mySlides has no width in style.css baseline;
   without this, JS display:block causes the div to expand to image intrinsic
   width, overflowing the viewport at all breakpoints.
   ========================================================================== */
.mySlides {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* ==========================================================================
   TABLET (≤ 1024px)
   ========================================================================== */
@media (max-width: 1024px) {

    /* Header */
    .header-tagline {
        font-size: 0.78rem;
    }

    nav a, .nav-drop-btn {
        font-size: 0.7rem;
        padding: 10px 13px;
    }

    /* Hero */
    .slideshow-container {
        height: 420px;
    }

    .hero-overlay h1 {
        font-size: 2.2rem;
    }

    .hero-overlay p {
        font-size: 1rem;
    }

    /* Solutions grid: 4 → 2 columns */
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Phone grid: 4 → 2 columns */
    .phone-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Product layout: 2-col → 1-col */
    .product-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* Footer: 3-col → 1-col */
    .footer-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* ==========================================================================
   MOBILE (≤ 768px)
   ========================================================================== */
@media (max-width: 768px) {

    /* -----------------------------------------------------------------------
       HEADER & HAMBURGER NAV
       --------------------------------------------------------------------- */
    header {
        padding: 12px 5%;
        flex-wrap: wrap;
        gap: 0;
    }

    .header-left-group {
        flex: 1;
    }

    .logo-container img {
        height: 55px;
    }

    .header-separator {
        height: 44px;
    }

    .header-tagline {
        font-size: 0.7rem;
        white-space: normal;
        max-width: 160px;
        line-height: 1.3;
    }

    /* Hamburger button — hidden on desktop via display:none default */
    .nav-hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: 2px solid var(--primary-plum);
        border-radius: 8px;
        width: 44px;
        height: 44px;
        cursor: pointer;
        padding: 0;
        flex-shrink: 0;
        transition: background 0.3s ease;
    }

    .nav-hamburger:hover {
        background: var(--primary-plum);
    }

    .nav-hamburger:hover .ham-bar {
        background: white;
    }

    .ham-bar {
        display: block;
        width: 22px;
        height: 2px;
        background: var(--primary-plum);
        border-radius: 2px;
        position: relative;
        transition: background 0.3s ease;
    }

    .ham-bar::before,
    .ham-bar::after {
        content: '';
        display: block;
        width: 22px;
        height: 2px;
        background: inherit;
        border-radius: 2px;
        position: absolute;
        left: 0;
        transition: transform 0.3s ease, top 0.3s ease, bottom 0.3s ease, opacity 0.3s ease;
    }

    .ham-bar::before { top: -7px; }
    .ham-bar::after  { bottom: -7px; }

    /* Animated X when open */
    .nav-hamburger.is-open .ham-bar {
        background: transparent;
    }
    .nav-hamburger.is-open .ham-bar::before {
        top: 0;
        transform: rotate(45deg);
        background: var(--primary-plum);
    }
    .nav-hamburger.is-open .ham-bar::after {
        bottom: 0;
        transform: rotate(-45deg);
        background: var(--primary-plum);
    }

    /* Nav: collapse by default, expand when .nav-open is set on <nav> */
    nav {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease;
        margin-top: 0;
    }

    nav.nav-open {
        max-height: 600px;
        margin-top: 12px;
    }

    nav a, .nav-drop-btn {
        width: 100%;
        text-align: left;
        border-radius: 8px;
        padding: 12px 16px;
        font-size: 0.82rem;
        margin-bottom: 4px;
        box-sizing: border-box;
    }

    /* Dropdowns become accordion */
    .dropdown {
        display: block;
        width: 100%;
    }

    .dropdown-content {
        position: static;
        box-shadow: none;
        border-radius: 0 0 8px 8px;
        border-left: 3px solid var(--accent-cyan);
        padding: 4px 0 4px 10px;
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .dropdown.drop-open .dropdown-content {
        max-height: 400px;
    }

    .dropdown-content a {
        font-size: 0.8rem !important;
        padding: 9px 12px !important;
        border-radius: 6px !important;
    }

    .dropdown-content a:hover {
        transform: none;
    }

    /* Language switch: pull it to natural flow */
    a.lang-switch {
        margin-left: 0;
        width: 60px;
        text-align: center;
        border-radius: 8px;
    }

    /* Active nav highlights still apply — no override needed */

    /* -----------------------------------------------------------------------
       HERO SLIDESHOW
       --------------------------------------------------------------------- */
    .slideshow-container {
        height: auto;
        min-height: 260px;
        overflow: hidden;
        width: 100%;
        max-width: 100vw;
    }

    .mySlides {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }

    .mySlides img {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 260px !important;
        object-fit: cover !important;
        object-position: center top !important;
    }

    .hero-overlay {
        position: static;
        transform: none;
        background: white;
        padding: 20px 5%;
        max-width: 100%;
        left: auto;
        top: auto;
    }

    .hero-overlay h1 {
        font-size: 1.6rem;
        color: var(--primary-plum);
        margin-bottom: 12px;
    }

    .hero-overlay p {
        font-size: 0.95rem;
        color: #444;
        margin-bottom: 16px;
    }

    .hero-bottom-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .btn-appointment {
        width: 100%;
        text-align: center;
        padding: 14px 20px;
    }

    .hero-video-thumb {
        width: 100%;
        max-width: 300px;
    }

    .slideshow-badges {
        position: static;
        justify-content: center;
        background: rgba(244,247,246,0.9);
        border-top: 1px solid #eee;
        border-radius: 0;
        padding: 10px 5%;
    }

    .slideshow-badges img {
        height: 38px;
    }

    /* -----------------------------------------------------------------------
       SOLUTIONS GRID
       --------------------------------------------------------------------- */
    .categories-section {
        padding: 40px 5%;
    }

    .categories-section h2 {
        font-size: 1.6rem;
        margin-bottom: 20px;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
        margin: 20px auto;
    }

    .category-card {
        min-height: 100px;
        padding: 16px 12px;
    }

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

    /* -----------------------------------------------------------------------
       PAGE BANNER
       --------------------------------------------------------------------- */
    .page-banner {
        padding: 20px 5%;
    }

    .page-banner h1 {
        font-size: 1.7rem;
    }

    .page-banner p {
        font-size: 0.95rem;
    }

    /* -----------------------------------------------------------------------
       PAGE INTRO
       --------------------------------------------------------------------- */
    .page-intro p {
        font-size: 0.95rem;
        text-align: left;
    }

    /* -----------------------------------------------------------------------
       PRODUCT LAYOUT (systemes.php)
       --------------------------------------------------------------------- */

    /* inline-block on h2 causes container to stretch to text width on mobile */
    .product-section-inner h2 {
        display: block;
        font-size: 1.5rem;
        word-break: break-word;
    }

    .product-section-inner {
        padding: 0 5%;
        overflow: hidden;
    }

    .product-layout {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .product-images {
        grid-template-columns: 1fr 1fr;
        max-width: 100%;
        overflow: hidden;
    }

    /* Single-image sections: full width */
    .product-images:has(> img:only-child) {
        grid-template-columns: 1fr;
    }

    /* Override fixed px widths set in systemes.php inline <style> block */
    .product-images img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        padding-left: 0 !important;
        padding-bottom: 0 !important;
    }

    .product-images img.img-small {
        width: 100% !important;
    }

    /* Model table: horizontal scroll */
    .model-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    .model-table {
        width: 100%;
        min-width: unset;
        table-layout: fixed;
        word-break: break-word;
    }

    .model-table th,
    .model-table td {
        word-break: break-word;
        white-space: normal;
        font-size: 0.8rem;
        padding: 8px 10px;
    }

    /* Product features list overflow fix */
    .product-features {
        max-width: 100%;
        overflow: hidden;
    }

    .product-features ul {
        padding-left: 18px;
    }

    .product-features ul li {
        word-break: break-word;
        overflow-wrap: break-word;
    }

    .product-left-col {
        max-width: 100%;
        overflow: hidden;
    }

    /* -----------------------------------------------------------------------
       PHONE GRID (telephones.php, tel-heberges.php)
       --------------------------------------------------------------------- */

    /* Same inline-block heading issue as product-section-inner h2 */
    .phone-section-inner h2 {
        display: block;
        font-size: 1.4rem;
        word-break: break-word;
    }

    .phone-section {
        padding: 35px 5%;
    }

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

    .phone-card img {
        width: 110px;
        height: 95px;
    }

    .phone-card h3 {
        font-size: 0.85rem;
    }

    .phone-card p {
        font-size: 0.78rem;
    }

    /* -----------------------------------------------------------------------
       FORFAITS GRID (nuagique.php)
       --------------------------------------------------------------------- */
    .forfaits-section {
        padding: 40px 5%;
    }

    .forfaits-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .forfait-card {
        padding: 22px;
    }

    .forfait-card-subheader {
        flex-direction: column;
        gap: 10px;
    }

    .forfait-price {
        align-self: flex-start;
    }

    /* -----------------------------------------------------------------------
       GARDER NUMÉRO IFRAME (nuagique.php, lignes-ip.php, telecopieurs.php)
       --------------------------------------------------------------------- */
    .garder-numero-section {
        padding: 40px 5%;
    }

    .iframe-wrapper iframe {
        height: 797px;
    }

    /* -----------------------------------------------------------------------
       CONTACT PAGE
       --------------------------------------------------------------------- */
    .contact-main-wrapper {
        padding: 40px 0;
    }

    .contact-container {
        flex-direction: column;
        gap: 30px;
    }

    .contact-info {
        min-width: unset;
    }

    .contact-info h1 {
        font-size: 2rem;
    }

    .contact-form-wrapper {
        min-width: unset;
        padding: 25px;
    }

    /* -----------------------------------------------------------------------
       TELECOPIEURS / LIGNES-IP - SERVICE CARDS
       (inline <style> in page defines grid-template-columns: 1fr 160px)
       --------------------------------------------------------------------- */
    .service-card {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    .service-price-badge {
        width: 100% !important;
        border-radius: 10px !important;
        padding: 16px !important;
        flex-direction: row !important;
        justify-content: center !important;
        gap: 12px !important;
        flex-wrap: wrap !important;
    }

    .service-price-badge .price-amount {
        font-size: 1.5rem !important;
    }

    /* -----------------------------------------------------------------------
       CONTACT CTA BANNER
       --------------------------------------------------------------------- */
    .contact-cta {
        padding: 35px 5%;
    }

    .contact-cta p {
        font-size: 0.95rem;
    }

    /* -----------------------------------------------------------------------
       FOOTER
       --------------------------------------------------------------------- */
    footer {
        padding: 40px 5% 20px;
        margin-top: 0;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    /* -----------------------------------------------------------------------
       CONSTRUCTION BANNER
       --------------------------------------------------------------------- */
    .construction-banner {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        padding: 12px 5%;
    }

    /* -----------------------------------------------------------------------
       INTERCOM
       --------------------------------------------------------------------- */

    /* Collapse sidebar+content grid to single column; hide sidebar on mobile */
    .intercom-wrapper {
        grid-template-columns: 1fr !important;
        padding: 0 !important;
    }

    .intercom-section {
        padding: 35px 5% !important;
    }

    .intercom-sidebar {
        display: none !important;
    }

    /* inline-block h2 causes overflow */
    .intercom-section h2 {
        display: block !important;
        font-size: 1.3rem !important;
        word-break: break-word !important;
    }

    /* 4-col algo grid → 2-col */
    .algo-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 14px !important;
    }

    /* -----------------------------------------------------------------------
       ENREGISTREMENTS
       --------------------------------------------------------------------- */

    /* 3-col audio grid → 1-col */
    .audio-grid {
        grid-template-columns: 1fr !important;
    }

    /* inline-block h2 */
    .recordings-inner h2 {
        display: block !important;
        font-size: 1.4rem !important;
        word-break: break-word !important;
    }

    /* -----------------------------------------------------------------------
       LIGNES-IP — first card volume discount wrapper has inline width:160px
       --------------------------------------------------------------------- */
    .service-card > div[style*="width: 160px"],
    .service-card > div[style*="width:160px"] {
        width: 100% !important;
        flex-shrink: 1 !important;
    }

    /* -----------------------------------------------------------------------
       MERCI — inline styles on .merci-card and .btn-merci override with !important
       --------------------------------------------------------------------- */
    .merci-card {
        padding: 30px 20px !important;
        flex: 0 1 100% !important;
    }

    .btn-merci {
        padding: 13px 28px !important;
        width: auto !important;
        display: inline-block !important;
        line-height: 1.2 !important;
        white-space: nowrap !important;
    }

    /* -----------------------------------------------------------------------
       INTERCOM / ACCESSOIRES — generic section padding
       --------------------------------------------------------------------- */
    .product-section-inner {
        padding: 0 5%;
    }

    .product-section {
        padding: 40px 0;
    }
}

/* ==========================================================================
   SMALL MOBILE (≤ 480px)
   ========================================================================== */
@media (max-width: 480px) {

    .logo-container img {
        height: 46px;
    }

    .header-tagline {
        display: none; /* Too cramped at this width */
    }

    .header-separator {
        display: none;
    }

    .hero-overlay h1 {
        font-size: 1.35rem;
    }

    .categories-grid {
        grid-template-columns: 1fr;
    }

    .phone-grid {
        grid-template-columns: 1fr 1fr; /* 2-col stays readable at 480 */
    }

    .page-banner h1 {
        font-size: 1.4rem;
    }

    .contact-info h1 {
        font-size: 1.6rem;
    }

    .forfaits-grid {
        grid-template-columns: 1fr;
    }

    /* Video modal iframe fills screen */
    .video-modal-box iframe {
        width: 95vw;
        height: calc(95vw * 0.5625); /* 16:9 ratio */
    }
}


