/* Responsive – Omniprotek – Production Ready */

/* ==============================
   GLOBAL MOBILE SAFETY
   ============================== */
html {
  overflow-x: hidden;
}

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

/* ==============================
   TABLETTE (≤ 1024px)
   ============================== */
@media (max-width: 1024px) {
  .header-inner {
    padding: 0 16px;
  }

  .logo-text { width: 280px; height: auto; }

  .nav-menu a { padding: 12px 16px; font-size: 14px; }

  /* Pages internes */
  .svc, .gal, .real-grid, .law-box, .law-image, .page-hero, .contact-section {
    margin-left: 16px;
    margin-right: 16px;
  }

  .law-box-inner {
    padding: 32px 28px;
  }

  /* Homepage */
  .home-hero-title {
    font-size: 38px;
  }

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

  .home-card:last-child {
    grid-column: 1 / -1;
    max-width: 480px;
    margin: 0 auto;
  }

  /* Footer */
  .site-footer {
    padding: 24px 16px 32px;
  }

  .footer-copyright, .footer-contact {
    white-space: normal;
    text-align: center;
  }
}

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

  /* --- Header --- */
  .header-inner {
    padding: 0 12px;
  }

  .header-logos { padding: 8px 0; }
  .logo-ball { width: 50px; height: 48px; }
  .logo-text { width: 220px; height: auto; }

  .site-header {
    margin-bottom: 0;
  }

  .site-header.is-scrolled .header-logos { padding: 2px 0 4px; }
  .site-header.is-scrolled .logo-ball { width: 32px; height: 30px; }
  .site-header.is-scrolled .logo-text { width: 160px; height: auto; }

  /* --- Hamburger menu --- */
  .menu-toggle {
    display: block;
  }

  .header-nav-row {
    display: block;
    padding: 0;
  }

  .header-nav-row nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .nav-menu {
    display: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
    max-width: none;
    background: var(--white);
    border-top: 1px solid var(--gray);
    flex-wrap: nowrap;
    gap: 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  }

  .nav-menu.is-open {
    display: flex;
  }

  .nav-menu > li {
    position: relative;
    width: 100%;
  }

  .nav-menu > li + li::before { display: none; }
  .nav-menu > li > a::after { display: none; }

  .nav-menu a {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-bg-light);
    font-size: 15px;
    text-align: left;
    width: 100%;
    display: block;
  }

  .nav-menu > li:last-child > a {
    border-bottom: none;
  }

  .nav-dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    background: var(--gray-bg-light);
    margin-left: 0;
    min-width: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .nav-dropdown li {
    width: 100%;
  }

  .nav-dropdown a {
    padding: 14px 20px 14px 40px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-size: 14px;
    white-space: normal;
  }

  .nav-dropdown li:last-child a {
    border-bottom: none;
  }

  .nav-menu > li.is-open .nav-dropdown {
    max-height: 500px;
  }

  .nav-menu > li.is-open > a {
    font-weight: 600;
    background: var(--gray-bg-light);
  }

  /* --- Homepage Hero --- */
  .home-hero {
    height: 65vh;
    min-height: 380px;
    max-height: 600px;
  }

  .home-hero-content {
    padding: 0 20px;
  }

  .home-hero-sub {
    font-size: 11px;
    letter-spacing: 0.15em;
    margin-bottom: 12px;
  }

  .home-hero-title {
    font-size: 26px;
    line-height: 1.2;
    margin-bottom: 14px;
  }

  .home-hero-desc {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 24px;
  }

  .home-hero-title br,
  .home-hero-desc br { display: none; }

  .home-hero-actions {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .btn-hero-primary, .btn-hero-secondary {
    padding: 12px 32px;
    font-size: 13px;
    width: 240px;
    text-align: center;
  }

  /* --- Homepage Sections --- */
  .home-services {
    padding: 40px 0 30px;
  }

  .home-services-inner {
    padding: 0 16px;
  }

  .home-section-head {
    margin-bottom: 28px;
  }

  .home-section-title {
    font-size: 20px;
    letter-spacing: 0.08em;
  }

  .home-section-sub {
    font-size: 14px;
  }

  .home-cards {
    grid-template-columns: 1fr;
    gap: 16px;
    perspective: none;
  }

  .home-card:last-child {
    max-width: none;
    grid-column: auto;
  }

  .home-card {
    transform-style: flat;
  }

  .home-card:hover {
    transform: translateY(-4px);
  }

  .home-card-img {
    height: 180px;
  }

  .home-card-body {
    padding: 18px 16px 20px;
  }

  .home-card-body h3 {
    font-size: 18px;
  }

  /* --- Quote --- */
  .home-quote {
    padding: 40px 20px;
  }

  .home-quote blockquote p {
    font-size: 17px;
    line-height: 1.6;
  }

  .home-quote cite {
    font-size: 13px;
  }

  /* --- Contact rapide --- */
  .home-contact {
    padding: 40px 16px;
  }

  .home-contact h2 {
    font-size: 22px;
  }

  .home-contact p {
    font-size: 14px;
    margin-bottom: 20px;
  }

  .home-contact-links {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .home-contact-pill {
    font-size: 13px;
    padding: 10px 18px;
    width: 100%;
    max-width: 300px;
    justify-content: center;
  }

  .btn-hero-primary {
    width: 100%;
    max-width: 300px;
    text-align: center;
  }

  /* --- Marquee partenaires --- */
  .home-partners {
    padding: 40px 0 30px;
  }

  .marquee-item {
    width: 90px;
    height: 55px;
  }

  .marquee-track {
    gap: 28px;
    animation-duration: 20s;
  }

  /* --- Footer --- */
  .site-footer {
    margin-top: 20px;
    padding: 16px 16px 24px;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .footer-copyright, .footer-contact {
    white-space: normal;
    font-size: 12px;
  }

  .footer-social {
    justify-content: center;
  }

  .footer-social a {
    width: 32px;
    height: 32px;
  }

  .footer-social img {
    width: 18px;
    height: 18px;
  }

  /* --- Boutons flottants --- */
  .back-to-top {
    bottom: 72px;
    right: 14px;
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .contact-fab {
    bottom: 14px;
    right: 14px;
    width: 46px;
    height: 46px;
  }

  .contact-fab-icon {
    font-size: 20px;
  }

  .contact-fab-label {
    font-size: 12px;
    padding: 8px 12px;
    margin-right: 8px;
  }

  /* --- Pages internes --- */
  .page-hero {
    margin: 0 12px 12px;
    padding: 18px 16px;
  }

  .page-title {
    font-size: 20px;
    letter-spacing: 0.08em;
  }

  /* Services */
  .svc {
    margin-left: 12px;
    margin-right: 12px;
    margin-bottom: 24px;
  }

  .svc-bar h2 {
    font-size: 18px;
    letter-spacing: 0.06em;
  }

  .svc-body.cols,
  .svc-body.cols-text-left,
  .svc-body.cols-img-left {
    grid-template-columns: 1fr;
  }

  .svc-body.cols-text-left .svc-text,
  .svc-body.cols-img-left .svc-text,
  .svc-body.cols-text-left .svc-text-stack,
  .svc-body.cols-img-left .svc-text-stack { order: 2; }
  .svc-body.cols-text-left .svc-img,
  .svc-body.cols-img-left .svc-img { order: 1; }

  .svc-text {
    padding: 20px 16px;
    font-size: 14px;
  }

  .svc-text h3 { font-size: 16px; }
  .svc-text h4 { font-size: 15px; }

  .svc-bottom-text {
    padding: 14px 16px;
    font-size: 13px;
  }

  .svc-sep {
    max-width: 80%;
  }

  /* Réalisations */
  .real-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-left: 12px;
    margin-right: 12px;
  }

  .real-card img {
    height: 220px;
  }

  .real-card .real-label {
    font-size: 14px;
    padding: 20px 12px 10px;
  }

  /* Galeries */
  .gal {
    margin-left: 12px;
    margin-right: 12px;
  }

  .gal-bar {
    padding: 14px 16px;
  }

  .gal-bar h2 {
    font-size: 18px;
  }

  .gal-row-2,
  .gal-row-3,
  .gal-row-4,
  .gal-row-6,
  .gal-row-1-2,
  .gal-row-2-1 {
    grid-template-columns: 1fr;
  }

  .gal-row-1-2 .gal-tall {
    grid-row: auto;
  }

  .gal-row-wide img {
    max-height: 280px;
  }

  .gal-row-2.tall img {
    max-height: 350px;
  }

  .gal-testimonials {
    padding: 24px 16px;
  }

  .gal-testimonial blockquote {
    font-size: 13px;
    padding-left: 14px;
  }

  /* Législation */
  .law-box {
    margin-left: 12px;
    margin-right: 12px;
  }

  .law-box-inner {
    padding: 20px 16px;
  }

  .law-article p,
  .law-heading {
    font-size: 14px;
  }

  .law-image {
    margin-left: 12px;
    margin-right: 12px;
  }

  /* Devis/Contact */
  .contact-section {
    margin-left: 12px;
    margin-right: 12px;
    padding: 0;
  }

  .contact-intro {
    font-size: 14px;
    margin-bottom: 20px;
  }

  .contact-wrapper {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .cf-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .cf-fields {
    margin-bottom: 14px;
  }

  .cf-group input,
  .cf-message textarea {
    padding: 12px 14px;
    font-size: 16px; /* évite le zoom auto iOS */
  }

  .cf-message textarea {
    min-height: 140px;
  }

  .cf-submit-row {
    text-align: center;
  }

  .btn-submit {
    width: 100%;
    padding: 14px 24px;
  }

  .contact-info-card {
    padding: 24px 20px;
  }

  .contact-info-card h3 {
    font-size: 18px;
  }

  .ci-row {
    font-size: 13px;
  }

  /* Alertes */
  .form-alert {
    margin-left: 12px;
    margin-right: 12px;
    font-size: 13px;
    padding: 14px 16px;
  }

  /* Lightbox */
  .lightbox-overlay img {
    max-width: 95vw;
    max-height: 80vh;
  }

  .lightbox-close {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    font-size: 20px;
  }
}

/* ==============================
   PETIT MOBILE (≤ 480px)
   ============================== */
@media (max-width: 480px) {
  .logo-ball { width: 40px; height: 38px; }
  .logo-text { width: 170px; }

  .site-header.is-scrolled .logo-ball { width: 28px; height: 26px; }
  .site-header.is-scrolled .logo-text { width: 140px; }

  .home-hero {
    height: 55vh;
    min-height: 340px;
  }

  .home-hero-title { font-size: 22px; }
  .home-hero-sub { font-size: 10px; letter-spacing: 0.1em; }
  .home-hero-desc { font-size: 13px; }

  .btn-hero-primary, .btn-hero-secondary {
    padding: 11px 24px;
    font-size: 12px;
  }

  .home-card-img {
    height: 160px;
  }

  .home-quote blockquote p {
    font-size: 15px;
  }

  .page-title {
    font-size: 18px;
  }

  .svc-bar h2 {
    font-size: 16px;
  }

  .real-card img {
    height: 180px;
  }

  .marquee-item {
    width: 70px;
    height: 45px;
  }

  .marquee-track {
    gap: 20px;
  }

  .footer-copyright, .footer-contact {
    font-size: 11px;
  }
}

/* ==============================
   TRÈS PETIT MOBILE (≤ 360px)
   ============================== */
@media (max-width: 360px) {
  .logo-text { width: 140px; }

  .home-hero-title { font-size: 20px; }

  .home-hero-content {
    padding: 0 14px;
  }

  .btn-hero-primary, .btn-hero-secondary {
    width: 100%;
    max-width: 220px;
  }

  .nav-menu a {
    padding: 12px 16px;
    font-size: 14px;
  }
}

/* ==============================
   PAYSAGE MOBILE
   ============================== */
@media (max-height: 500px) and (orientation: landscape) {
  .home-hero {
    height: auto;
    min-height: 300px;
    max-height: 400px;
  }

  .home-hero-title {
    font-size: 24px;
  }

  .home-hero-desc {
    display: none;
  }

  .home-hero-sub {
    margin-bottom: 8px;
  }

  .home-hero-actions {
    flex-direction: row;
    gap: 12px;
  }

  .btn-hero-primary, .btn-hero-secondary {
    width: auto;
    padding: 10px 24px;
    font-size: 12px;
  }
}
