/* ==========================================================================
   Authentique Services — responsive mobile-first overrides
   ========================================================================== */

html {
    overflow-x: clip;
    -webkit-text-size-adjust: 100%;
}

body {
    overflow-x: clip;
    min-width: 320px;
}

.site-body-offset {
    --site-top-bar-h: 2.25rem;
    --site-header-h: 4.25rem;
    padding-top: calc(var(--site-top-bar-h) + var(--site-header-h));
    scroll-padding-top: calc(var(--site-top-bar-h) + var(--site-header-h) + 0.25rem);
}

@media (min-width: 1024px) {
    .site-body-offset {
        --site-top-bar-h: 2.75rem;
        --site-header-h: 5rem;
        padding-top: calc(var(--site-top-bar-h) + var(--site-header-h));
        scroll-padding-top: calc(var(--site-top-bar-h) + var(--site-header-h) + 0.25rem);
    }
}

img:not(.site-logo):not(.page-loader-logo):not(.shop-product-image):not(.visit-photo-main):not(.visit-photo-side):not(.service-img-card img),
iframe {
    max-width: 100%;
    height: auto;
}

.site-logo {
    display: block;
    flex-shrink: 0;
    width: auto;
    height: 2.75rem;
    max-height: 2.75rem;
    max-width: 2.75rem;
    object-fit: contain;
}

.site-brand {
    max-width: min(52vw, 14rem);
}

@media (min-width: 640px) {
    .site-brand {
        max-width: none;
    }
}

@media (max-width: 639px) {
    .site-logo {
        height: 2.25rem;
        max-height: 2.25rem;
        max-width: 2.25rem;
    }
}

.hero-video-bg video {
    max-width: none;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Header & navigation --- */
@media (max-width: 1279px) {
    #mobile-menu {
        width: min(100vw, 20rem);
        max-width: 100%;
    }
}

@media (max-width: 639px) {
    #main-header nav {
        /* height: 2rem; */
        overflow: hidden;
    }

    #main-header .site-brand {
        max-width: calc(100vw - 8.5rem);
    }

    #main-header .btn-primary {
        display: none !important;
    }

    .lang-switcher--navbar {
        padding: 2px;
        gap: 2px;
        align-self: center;
    }

    .lang-switcher--navbar .lang-pill {
        padding: 3px 6px;
        font-size: 10px;
        gap: 3px;
        min-height: 0;
    }

    .lang-switcher--navbar .lang-pill-flag {
        font-size: 11px;
        width: 11px;
        height: 11px;
    }

    .lang-switcher--mobile {
        padding: 2px;
    }

    .lang-switcher--mobile .lang-pill {
        padding: 5px 8px;
        font-size: 10px;
    }

    .lang-switcher--mobile .lang-pill-flag {
        font-size: 12px;
        width: 12px;
        height: 12px;
    }
}

/* --- Hero accueil --- */
@media (max-width: 1023px) {
    .stats-bridge {
        margin-top: -2.5rem;
        margin-bottom: -2.5rem;
    }
}

@media (max-width: 639px) {
    .home-hero {
        min-height: 58vh !important;
        padding-bottom: 3rem !important;
    }

    .stats-bridge {
        margin-top: -1.75rem;
        margin-bottom: -1.75rem;
    }

    .hero-stats {
        border-radius: 10px;
    }

    .hero-stats-grid > div {
        padding: 1rem 0.5rem !important;
    }

    .hero-stats-grid.divide-x > :not([hidden]) ~ :not([hidden]) {
        --tw-divide-x-reverse: 0;
        border-inline-start-width: 0;
    }

    .hero-stats-grid > div:nth-child(odd) {
        border-right: 1px solid rgba(196, 197, 218, 0.35);
    }

    .hero-stats-grid > div:nth-child(1),
    .hero-stats-grid > div:nth-child(2) {
        border-bottom: 1px solid rgba(196, 197, 218, 0.35);
    }

    .hero-stat-num {
        font-size: 1.5rem !important;
    }

    .hero-stat-label {
        font-size: 9px;
        letter-spacing: 0.08em;
        line-height: 1.3;
    }

    .home-after-stats {
        padding-top: 3.5rem !important;
    }
}

/* --- Boutons --- */
@media (max-width: 479px) {
    .btn-primary,
    .btn-outline-dark,
    .btn-outline-light,
    .btn-google-review {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .hero-cta-row .btn-primary,
    .hero-cta-row .btn-outline-light {
        width: 100%;
    }

    .cta-strip {
        flex-direction: column;
        align-items: stretch !important;
        text-align: center;
        padding: 1.5rem 1.25rem !important;
    }

    .cta-strip .btn-primary,
    .cta-strip button {
        width: 100%;
        justify-content: center;
    }
}

/* --- Sections --- */
@media (max-width: 767px) {
    .section-header {
        margin-bottom: 2rem;
    }

    .section-title {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }

    .about-image-wrap::before {
        top: -8px;
        left: -8px;
        width: 48px;
        height: 48px;
    }

    .about-image-wrap img {
        border-radius: 8px;
    }

    .service-img-card {
        min-height: 220px;
    }

    .visit-photo-grid {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto !important;
        min-height: 0 !important;
    }

    .visit-photo-main {
        grid-row: auto !important;
        min-height: 220px;
    }

    .visit-photo-side {
        min-height: 180px;
    }

    .testimonial-marquee-card {
        width: min(85vw, 340px) !important;
        padding: 1.5rem 1.25rem !important;
    }

    .marquee-infinite-set {
        gap: 2rem;
        padding: 0 1rem;
    }
}

/* --- Page hero (pages intérieures) --- */
@media (max-width: 767px) {
    .page-hero {
        padding: 2.25rem 0 3rem !important;
        min-height: 0 !important;
    }

    .page-hero .section-title,
    .page-hero h1 {
        font-size: clamp(1.625rem, 7vw, 2.25rem) !important;
    }

    .page-breadcrumb {
        font-size: 12px;
    }
}

/* --- Footer --- */
@media (max-width: 767px) {
    .footer-main .max-w-container-max {
        padding-top: 2.5rem !important;
        padding-bottom: 2rem !important;
    }

    .footer-main .border-t {
        text-align: center;
    }

    .footer-main .border-t > div {
        justify-content: center;
    }

    .footer-main .border-t p {
        line-height: 1.6;
    }
}

/* --- Top bar mobile --- */
@media (max-width: 1023px) {
    .top-bar-social-link {
        width: 28px;
        height: 28px;
    }

    .top-bar-social-link svg {
        width: 12px;
        height: 12px;
    }

    .top-bar-socials {
        gap: 0.35rem;
    }
}

/* --- Showroom visite : image en premier sur mobile --- */
@media (max-width: 1023px) {
    #visite .visit-photo-grid {
        margin-bottom: 0.5rem;
    }

    #visite .visit-photo-main,
    #visite .visit-photo-side {
        width: 100%;
        height: auto;
        max-height: none;
        aspect-ratio: 4 / 3;
        object-fit: cover;
    }
}

/* --- Boutique imprimantes --- */
.shop-section {
    overflow-x: clip;
}

@media (max-width: 1023px) {
    .shop-toolbar {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
    }

    .shop-toolbar-count {
        font-size: 1.125rem;
    }

    .shop-layout {
        gap: 1.25rem;
    }

    .shop-sidebar-card {
        position: static !important;
        padding: 0.875rem !important;
        border-radius: 12px;
    }

    .shop-sidebar-title {
        margin-bottom: 0.65rem;
    }

    .shop-sidebar-cta {
        display: none;
    }

    .shop-category-list {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0.5rem;
        padding-bottom: 0.35rem;
        margin: 0 -0.25rem;
        scrollbar-width: none;
    }

    .shop-category-list::-webkit-scrollbar {
        display: none;
    }

    .shop-category-btn {
        width: auto !important;
        flex-shrink: 0;
        white-space: nowrap;
        padding: 0.55rem 0.85rem;
        font-size: 12px;
    }

    .shop-product-card {
        min-width: 0;
    }

    .shop-product-media {
        aspect-ratio: 4 / 3;
    }

    .shop-product-image {
        width: 100%;
        height: 100%;
        max-width: none;
        object-fit: cover;
    }

    .shop-product-title {
        font-size: 0.9375rem;
        word-break: break-word;
    }

    .shop-product-excerpt {
        -webkit-line-clamp: 3;
    }

    .shop-product-footer {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem;
    }

    .shop-product-btn {
        width: 100%;
        justify-content: center;
        padding: 0.65rem 1rem;
    }

    .shop-product-overlay {
        opacity: 1;
        background: rgba(0, 53, 197, 0.35);
        font-size: 12px;
    }
}

@media (max-width: 639px) {
    .shop-grid {
        gap: 1rem;
    }

    .shop-product-body {
        padding: 1rem !important;
    }
}

/* --- Modals --- */
@media (max-width: 767px) {
    .devis-modal-panel {
        border-radius: 16px 16px 0 0 !important;
        max-height: 92dvh !important;
        width: 100% !important;
        max-width: 100% !important;
        transform: translateY(100%);
    }

    #devis-modal.open .devis-modal-panel {
        transform: translateY(0) !important;
    }

    .devis-modal-form {
        padding: 1.25rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px)) !important;
    }

    .devis-modal-form form {
        padding-top: 0.5rem;
    }

    #devis-modal {
        padding: 0 !important;
        align-items: flex-end !important;
    }

    #devis-modal #modal-close {
        top: 0.75rem;
        right: 0.75rem;
    }

    .printer-modal-panel {
        max-height: 92dvh !important;
        width: 100% !important;
        border-radius: 16px 16px 0 0 !important;
    }

    .printer-modal-form-wrap {
        padding: 1.25rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px)) !important;
        max-height: 92dvh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .printer-modal-mobile-head {
        display: block;
        padding-right: 2.75rem;
        margin-bottom: 1rem;
    }

    .printer-modal-mobile-title {
        font-family: 'Montserrat', sans-serif;
        font-size: 1.0625rem;
        font-weight: 800;
        color: #191c1e;
        margin: 0 0 0.35rem;
        line-height: 1.3;
    }

    .printer-modal-product-mobile {
        font-size: 0.875rem;
        font-weight: 600;
        color: #0035c5;
        margin: 0;
        line-height: 1.4;
    }

    .printer-modal-form-lead {
        padding-right: 0;
        font-size: 0.8125rem;
    }

    .printer-modal-grid {
        grid-template-columns: 1fr !important;
    }

    .printer-modal-close {
        top: 0.75rem;
        right: 0.75rem;
    }

    .printer-modal-submit {
        padding: 1rem 1.25rem;
    }
}

@media (min-width: 768px) {
    .printer-modal-mobile-head {
        display: none;
    }
}

/* --- Import-export badges --- */
@media (max-width: 639px) {
    .import-export-badges {
        display: none !important;
    }
}

/* --- Galerie / filtres --- */
@media (max-width: 639px) {
    .gallery-filter-pills {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
        margin-left: calc(-1 * var(--spacing-gutter, 1rem));
        margin-right: calc(-1 * var(--spacing-gutter, 1rem));
        padding-left: var(--spacing-gutter, 1rem);
        padding-right: var(--spacing-gutter, 1rem);
        scrollbar-width: none;
    }

    .gallery-filter-pills::-webkit-scrollbar {
        display: none;
    }

    .gallery-filter-pill {
        flex-shrink: 0;
    }

    .gallery-item .absolute.inset-0 {
        opacity: 1 !important;
    }

    .gallery-item .absolute.inset-0 .opacity-0 {
        opacity: 1;
    }
}

/* --- Contact --- */
@media (max-width: 639px) {
    .contact-info-card {
        padding: 1.5rem !important;
    }

    .card.p-8,
    .card.p-10 {
        padding: 1.25rem !important;
    }
}

/* --- Flottants (safe area iPhone) --- */
@supports (padding: max(0px)) {
    .float-whatsapp {
        bottom: max(5.5rem, calc(env(safe-area-inset-bottom) + 4.5rem));
        right: max(1rem, env(safe-area-inset-right));
    }

    .float-back-top {
        bottom: max(1.25rem, env(safe-area-inset-bottom));
        right: max(1rem, env(safe-area-inset-right));
    }
}

/* --- Grilles utilitaires --- */
@media (max-width: 639px) {
    .grid-gap-tight {
        gap: 1rem !important;
    }

    .overflow-touch-x {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* --- Lightbox --- */
@media (max-width: 639px) {
    #gallery-lightbox {
        padding: 0.75rem !important;
        align-items: flex-end !important;
    }

    #gallery-lightbox .lightbox-panel {
        border-radius: 16px 16px 0 0;
        max-height: 92vh;
        overflow-y: auto;
    }

    #gallery-lightbox .p-6 {
        padding: 1.25rem !important;
    }
}

/* --- Articles & contenu riche --- */
@media (max-width: 767px) {
    .article-body img,
    .prose img {
        border-radius: 8px;
    }

    .article-body table,
    .prose table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .prose-legal {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    #apropos .grid,
    .about-image-wrap {
        gap: 2.5rem;
    }

    .float-whatsapp {
        width: 50px;
        height: 50px;
        right: 1rem;
    }

    .float-back-top {
        width: 40px;
        height: 40px;
        right: 1rem;
    }
}
@media (hover: none) and (pointer: coarse) {
    .btn-primary:hover,
    .btn-outline-dark:hover,
    .btn-outline-light:hover,
    .service-img-card:hover,
    .card:hover {
        transform: none;
    }

    .nav-link,
    .mobile-link,
    button,
    a.btn-primary {
        min-height: 44px;
    }
}
