/* Concept System — variantes tablette & téléphone (priorité sur style.css) */

/* ── Tablette (769px — 1024px) ── */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        width: 92%;
    }

    .logo-block {
        width: 220px;
        height: 64px;
    }

    nav ul li a {
        padding: 8px 10px;
        font-size: 0.78rem;
    }

    .hero {
        padding: 72px 0;
    }

    .hero-content h1 {
        font-size: 2.75rem !important;
    }

    .hero-content p {
        font-size: 1.1rem !important;
    }

    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 28px !important;
    }

    .product-page-hero {
        padding: 48px 0 !important;
    }

    .product-page-hero .product-details h1 {
        font-size: 2.2rem !important;
    }

    #tendeur-catalogue h2,
    #fil-catalogue h2,
    .specs-section > h2 {
        font-size: 1.55rem;
    }

    .tendeur-detail-header.has-gallery,
    .fil-detail-header.has-gallery {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 18px !important;
    }

    .tendeur-detail-header.has-gallery .tendeur-detail-hero,
    .fil-detail-header.has-gallery .fil-detail-hero,
    .tendeur-detail-gallery,
    .fil-detail-gallery {
        max-width: min(340px, 100%);
        margin: 0;
    }

    .contact-wrapper {
        gap: 32px;
    }
}

/* ── Menu mobile + tablette portrait (≤ 992px) ── */
@media (max-width: 992px) {
    header {
        padding: 6px 0 !important;
        background: #fff;
        box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
    }

    header .navbar {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 0 6px !important;
    }

    .logo-block {
        width: min(148px, 42vw) !important;
        height: 44px !important;
        flex: 1 1 auto;
        min-width: 0;
        order: 1;
        align-self: center;
    }

    .logo-block img {
        object-position: left center;
    }

    .mobile-header-actions,
    .header-utils.header-utils--topbar,
    header .navbar > .header-utils {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-end !important;
        flex: 0 0 auto !important;
        order: 2;
        gap: 6px;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        width: auto !important;
    }

    .mobile-header-actions {
        margin-left: auto !important;
    }

    .header-utils.header-utils--topbar .lang-selector,
    header .navbar > .header-utils .lang-selector {
        display: flex;
        align-items: center;
        gap: 2px;
        padding: 3px 6px;
        background: #f4f4f4;
        border-radius: 999px;
    }

    .header-utils.header-utils--topbar .lang-selector a,
    header .navbar > .header-utils .lang-selector a {
        font-size: 0.68rem;
        font-weight: 700;
        padding: 3px 5px;
        line-height: 1;
    }

    .header-utils.header-utils--topbar .site-search-toggle,
    header .navbar > .header-utils .site-search-toggle {
        padding: 4px;
    }

    .header-utils.header-utils--topbar .site-search-toggle svg,
    header .navbar > .header-utils .site-search-toggle svg {
        width: 18px;
        height: 18px;
    }

    .header-utils.header-utils--topbar .social-link svg,
    header .navbar > .header-utils .social-link svg {
        width: 18px;
        height: 18px;
    }

    .nav-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        flex-shrink: 0;
        width: 40px;
        height: 40px;
        margin: 0 !important;
        order: 3;
        padding: 0;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        background: #fff;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .nav-toggle span {
        display: block;
        width: 20px;
        height: 2px;
        background: var(--anthracite, #333);
        border-radius: 2px;
        transition: transform 0.25s ease, opacity 0.2s ease;
    }

    body.nav-open .nav-toggle span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    body.nav-open .nav-toggle span:nth-child(2) {
        opacity: 0;
    }

    body.nav-open .nav-toggle span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    header nav {
        display: none;
        flex-direction: column;
        align-items: stretch;
        flex: 1 1 100%;
        width: 100%;
        order: 10;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid var(--border-color, #eee);
    }

    body.nav-open header nav {
        display: flex;
    }

    header nav > ul {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100%;
    }

    header nav > ul > li {
        margin: 0 !important;
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }

    header nav ul li a,
    header nav .quote-menu-btn {
        display: block !important;
        width: 100%;
        box-sizing: border-box;
        padding: 14px 6px !important;
        text-align: left;
        font-size: 0.9rem !important;
    }

    header nav .quote-menu-btn {
        justify-content: flex-start;
        border-radius: 0;
        border: none;
        border-bottom: 1px solid #f0f0f0;
        background: transparent;
    }

    header nav > ul > li.has-dropdown > ul.dropdown-menu,
    ul.dropdown-menu.nav-dropdown-portal {
        position: static !important;
        top: auto !important;
        left: auto !important;
        min-width: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 0 8px 12px !important;
        box-shadow: none !important;
        border: none !important;
        border-left: 3px solid var(--green-logo, #64b446) !important;
        background: #fafafa !important;
        display: none !important;
    }

    header nav > ul > li.has-dropdown.nav-dropdown-open > ul.dropdown-menu,
    header nav > ul > li.has-dropdown.nav-dropdown-open > ul.dropdown-menu.nav-dropdown-portal {
        display: block !important;
    }

    header nav > ul > li.has-dropdown > ul.dropdown-menu li a {
        padding: 12px 14px !important;
        font-size: 0.88rem !important;
        text-transform: none !important;
    }

    header nav .header-utils {
        display: none !important;
    }

    .product-intro,
    .tendeurs-product-hero.product-page-hero .product-intro,
    .cables-product-hero.product-page-hero .product-intro,
    .filets-product-hero.product-page-hero .product-intro {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
        align-items: start !important;
    }

    .tendeurs-product-hero.product-page-hero .product-gallery,
    .cables-product-hero.product-page-hero .product-gallery,
    .filets-product-hero.product-page-hero .product-gallery {
        width: 100% !important;
        max-width: 100% !important;
        justify-self: center !important;
    }

    .tendeurs-product-hero.product-page-hero .product-gallery img:not(.fil-hero-logo),
    .cables-product-hero.product-page-hero .product-gallery img:not(.fil-hero-logo),
    .filets-product-hero.product-page-hero .product-gallery img:not(.fil-hero-logo) {
        display: block;
        width: auto !important;
        max-width: min(320px, 100%) !important;
        height: auto !important;
        max-height: 260px !important;
        margin: 0 auto !important;
        object-fit: contain !important;
    }

    .product-page-hero .product-details {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .product-page-hero .product-gallery {
        justify-self: center;
        margin: 0 auto;
        max-width: 100%;
        overflow: hidden;
    }

    .product-page-hero {
        overflow-x: clip;
    }

    .mega-footer {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 24px !important;
    }

    .contact-wrapper {
        grid-template-columns: 1fr !important;
        padding: 40px 0 !important;
        gap: 32px;
    }

    .tendeur-catalog-toolbar,
    .fil-catalog-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .tendeur-search-input,
    .fil-search-input {
        width: 100%;
    }
}

/* Masquer le bouton menu sur desktop */
@media (min-width: 993px) {
    .nav-toggle {
        display: none !important;
    }
}

/* ── Téléphone (≤ 768px) ── */
@media (max-width: 768px) {
    .container {
        width: 94%;
    }

    .hero {
        padding: 56px 0 !important;
        min-height: 0 !important;
    }

    .hero-content h1 {
        font-size: 2rem !important;
        line-height: 1.15 !important;
    }

    .hero-content p {
        font-size: 1rem !important;
        margin-bottom: 24px !important;
    }

    .btn-primary,
    .btn-submit {
        display: block;
        width: 100%;
        text-align: center;
        box-sizing: border-box;
        min-height: 48px;
    }

    .product-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }

    .product-img {
        height: 200px !important;
    }

    .product-page-hero {
        padding: 32px 0 !important;
    }

    .product-page-hero .product-details h1 {
        font-size: 1.75rem !important;
    }

    .product-page-hero .product-details p {
        font-size: 1rem !important;
    }

    .product-page-hero .product-gallery {
        height: auto !important;
        max-height: none !important;
    }

    .filets-product-hero.product-page-hero .product-gallery .fil-hero-photo {
        max-height: 280px;
        margin: 0 auto;
    }

    .breadcrumb {
        font-size: 0.72rem !important;
        line-height: 1.45;
        margin-bottom: 14px !important;
    }

    .tendeur-breadcrumb,
    .fil-breadcrumb {
        font-size: 0.8rem;
        line-height: 1.45;
    }

    .tendeur-detail-header,
    .tendeur-detail-header.has-gallery,
    .fil-detail-header,
    .fil-detail-header.has-gallery {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        text-align: left !important;
        padding: 14px;
    }

    .tendeur-detail-header.has-gallery .tendeur-detail-hero,
    .fil-detail-header.has-gallery .fil-detail-hero,
    .tendeur-detail-gallery,
    .fil-detail-gallery {
        margin: 0;
        max-width: min(340px, 100%);
    }

    #tendeur-detail-title,
    #fil-detail-title {
        font-size: 1.1rem;
    }

    .gamme-filter button,
    .construction-filter button {
        min-height: 44px;
        padding: 10px 14px;
    }

    .tendeur-back-btn,
    .fil-back-btn {
        width: 100%;
        text-align: center;
        min-height: 44px;
    }

    .catalog-quote-action {
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 6px;
        max-width: none;
    }

    .quote-qty-input,
    .cable-length-input {
        width: 56px;
        min-height: 44px;
        font-size: 1rem;
    }

    .tendeur-catalog-table th:last-child,
    .tendeur-catalog-table td:last-child,
    .tendeur-catalog-table .quote-action-cell,
    .tendeur-catalog-table .quote-unit-cell,
    .veg-catalog-table th:last-child,
    .veg-catalog-table td:last-child {
        position: sticky;
        right: 0;
        z-index: 2;
        background: #fff;
        box-shadow: -6px 0 10px rgba(0, 0, 0, 0.06);
    }

    .tendeur-table-scroll,
    .fil-table-scroll,
    .veg-table-scroll {
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
    }

    .tendeur-table-scroll::after,
    .fil-table-scroll::after {
        content: "← glisser →";
        display: block;
        text-align: center;
        font-size: 0.72rem;
        color: #999;
        padding: 6px 0 2px;
    }

    .contact-form {
        padding: 0;
    }

    .contact-captcha-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .contact-captcha-row input[type="text"],
    .contact-captcha-row input[type="number"] {
        width: 100%;
        min-height: 48px;
        font-size: 1rem;
    }

    .contact-captcha-refresh {
        align-self: flex-end;
        min-width: 48px;
        min-height: 48px;
    }

    .contact-form .form-group input,
    .contact-form .form-group textarea {
        font-size: 16px;
    }

    .quote-cart-panel {
        left: 12px;
        right: 12px;
        bottom: 12px;
        width: auto;
        max-height: 65vh;
    }

    .quote-cart-actions {
        grid-template-columns: 1fr;
    }

    .mega-footer {
        grid-template-columns: 1fr !important;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .map-container {
        height: 260px !important;
    }
}

/* ── Petit téléphone (≤ 480px) ── */
@media (max-width: 480px) {
    .logo-block {
        width: min(170px, 52vw);
        height: 44px;
    }

    .hero-content h1 {
        font-size: 1.65rem !important;
    }

    .lang-selector {
        gap: 6px;
    }

    .lang-selector a {
        font-size: 0.7rem;
        padding: 4px 6px;
    }

    #tendeur-catalogue h2,
    #fil-catalogue h2,
    .specs-section > h2 {
        font-size: 1.25rem;
        padding-left: 14px;
    }

    .section-intro {
        font-size: 0.88rem;
    }

    .quote-cart-panel {
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 12px 12px 0 0;
        max-height: 72vh;
    }

    .add-quote-btn {
        width: 100%;
        max-width: 120px;
    }

    .inner-specs-table .add-quote-btn {
        max-width: none;
        width: auto;
    }
}
