/* ============================================================
   JM MECANOTECH - Design System (base.css)
   Palette : navy #1a365d | blue #4299e1 | orange #ed8936
   ============================================================ */

/* ---------- Reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }

body { background-color: #f8f9fa; color: #333; line-height: 1.6;
       overflow-x: hidden; transition: overflow 0.3s; }
body.menu-open { overflow: hidden; }

.container { width: 90%; max-width: 1200px; margin: 0 auto; padding: 0 15px; }

img { max-width: 100%; height: auto; }

/* ---------- Header ---------- */
header { background-color: rgba(26, 54, 93, 0.9); color: #fff;
         padding: 1rem 0; box-shadow: 0 2px 10px rgba(0,0,0,0.1);
         position: sticky; top: 0; z-index: 1000;
         transition: background-color 0.3s; }
.header-container { display: flex; justify-content: space-between;
                    align-items: center; }

.logo { font-size: 1.8rem; font-weight: 700; color: #fff; text-decoration: none;
        display: inline-flex; align-items: center; gap: .6rem; }
.logo picture { display: flex; }
.logo img { display: block; height: 40px; width: auto; flex-shrink: 0;
            filter: drop-shadow(0 0 1px rgba(255,255,255,.85)) drop-shadow(0 0 3px rgba(255,255,255,.3)); }
.logo .logo-text { color: #fff; }
.logo .logo-text span { color: #4299e1; }

/* ---------- Navigation desktop ---------- */
.nav-main { display: flex; gap: 1.4rem; align-items: center; }
.nav-main a { color: #cbd5e0; text-decoration: none; font-weight: 500;
              transition: color 0.3s; }
.nav-main a:hover, .nav-main a[aria-current="page"] { color: #fff; }
.nav-main a[aria-current="page"] { border-bottom: 2px solid #4299e1; }

.nav-main .btn-devis { background: #c05621; color: #fff; padding: 0.5rem 1.2rem;
                       border-radius: 4px; font-weight: 600; border-bottom: none; }
.nav-main .btn-devis:hover { background: #9c4221; color: #fff; }

/* ---------- Menu hamburger ---------- */
.menu-toggle { display: none; flex-direction: column; justify-content: space-between;
               width: 30px; height: 21px; background: transparent; border: none;
               cursor: pointer; padding: 0; z-index: 1001; }
.menu-toggle span { display: block; height: 3px; width: 100%; background: #fff;
                    border-radius: 3px; transition: all 0.3s ease; }
.menu-toggle.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ---------- Navigation mobile ---------- */
.nav-mobile { position: fixed; top: 0; right: -100%; width: 80%; max-width: 300px;
              height: 100vh; background-color: #1a365d; padding: 80px 2rem 2rem;
              transition: right 0.4s ease-in-out; z-index: 999; overflow-y: auto; }
.nav-mobile.active { right: 0; }
.nav-mobile a { display: block; color: #cbd5e0; text-decoration: none;
                padding: 1rem 0; border-bottom: 1px solid rgba(255,255,255,0.1);
                font-weight: 500; transition: color 0.3s; }
.nav-mobile a:hover, .nav-mobile a[aria-current="page"] { color: #fff; }

.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5);
           opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s;
           z-index: 998; }
.overlay.active { opacity: 1; visibility: visible; }

/* ---------- Boutons ---------- */
.btn { display: inline-block; padding: 1rem 2rem; background: #2b6cb0; color: #fff;
       border: none; border-radius: 4px; font-weight: 600; text-decoration: none;
       cursor: pointer; transition: all 0.3s; }
.btn:hover { background: #2c5282; transform: translateY(-2px); }

/* ---------- Sections ---------- */
section { padding: 4rem 0; }

/* ---------- Footer ---------- */
footer { background: #1a365d; color: #cbd5e0; padding: 3rem 0 0; }
.footer-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
                  gap: 2rem; padding-bottom: 2rem; }
.footer-section h3, .footer-section h4 { color: #fff; margin-bottom: 1rem; }
.footer-section a { color: #cbd5e0; text-decoration: none; display: block;
                    padding: 0.25rem 0; transition: color 0.3s; }
.footer-section a:hover { color: #4299e1; }
.footer-section p { margin: 0.5rem 0; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding: 1.5rem 0;
                 text-align: center; font-size: 0.9rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .nav-main { display: none; }
    .menu-toggle { display: flex; }
}

/* ---------- Pages regroupees (ascenseurs / equipements) ---------- */
.hub-hero { padding: 4rem 0 3rem; text-align: center; color: #fff;
            background: linear-gradient(135deg, #1a365d, #2b6cb0); }
.hub-hero h1 { color: #fff; font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: .8rem; }
.hub-hero p { color: #cbd5e0; max-width: 720px; margin: 0 auto; }
.subnav { position: sticky; top: 78px; z-index: 900; background: #fff;
          border-bottom: 1px solid #e2e8f0; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.subnav .container { display: flex; gap: .5rem; overflow-x: auto; padding: .6rem 15px; scrollbar-width: none; }
.subnav a { flex: none; color: #4a5568; text-decoration: none; font-size: .9rem; font-weight: 500;
            padding: .4rem .95rem; border: 1px solid #e2e8f0; border-radius: 999px; transition: all .25s; }
.subnav a:hover { color: #fff; background: #4299e1; border-color: #4299e1; }
.pg-block { scroll-margin-top: 140px; }

/* ========== Accessibilité ========== */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 3000; background: #1a365d; color: #fff; padding: .8rem 1.2rem; border-radius: 0 0 8px 0; font-weight: 600; }
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid #2b6cb0; outline-offset: 2px; }
header :focus-visible, footer :focus-visible, .hub-hero :focus-visible, .hero-slider :focus-visible, .lightbox :focus-visible, .nav-mobile :focus-visible { outline-color: #fff; }
main:focus { outline: none; }
.btn:focus-visible, .btn-devis:focus-visible { outline-offset: 3px; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
a[href^="tel:"] { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
header.scrolled { background: rgba(26, 54, 93, 1); }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ========== Responsive (320 px -> très grands écrans) ========== */
html { -webkit-text-size-adjust: 100%; }
body { overflow-wrap: break-word; }
img, svg, video, canvas { max-width: 100%; }
a[href^="mailto:"] { overflow-wrap: anywhere; }
@media (max-width: 600px) {
    .container { width: 94%; padding: 0 10px; }
    section { padding: 3rem 0; }
    .logo { font-size: 1.4rem; gap: .45rem; }
    .logo img { height: 32px; }
    .btn { padding: .85rem 1.4rem; }
    h1 { font-size: clamp(1.6rem, 7vw, 2.2rem); }
    h2 { font-size: clamp(1.35rem, 5.5vw, 1.8rem); }
    .hub-hero { padding: 3rem 0 2rem; }
}
@media (min-width: 1600px) { .container { max-width: 1400px; } }
@media (min-width: 2200px) { html { font-size: 112.5%; } .container { max-width: 1700px; } }

/* ========== Barre d'action mobile ========== */
.mobile-cta { display: none; }
@media (max-width: 768px) {
    .mobile-cta { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 950; box-shadow: 0 -2px 12px rgba(0,0,0,.2); padding-bottom: env(safe-area-inset-bottom, 0); background: #1a365d; }
    .mobile-cta a { flex: 1; text-align: center; padding: .95rem .5rem; color: #fff; font-weight: 700; text-decoration: none; }
    .mobile-cta .mc-call { background: #276749; }
    .mobile-cta .mc-devis { background: #c05621; }
    .mobile-cta .mc-wa { background: #0b7a62; }
    .mobile-cta a { font-size: .9rem; }
    body { padding-bottom: 56px; }
}

/* ========== Formulaires : messages et erreurs ========== */
.form-status:empty { display: none; }
.form-status { margin-bottom: 1.2rem; }
.field-error { display: block; color: #9b2c2c; font-size: .875rem; margin-top: .35rem; font-weight: 500; }
.form-group [aria-invalid="true"] { border-color: #c53030; }

/* ========== Page 404 ========== */
.nf { text-align: center; padding: 6rem 0; }
.nf h1 { color: #1a365d; font-size: 3rem; margin-bottom: 1rem; }
.nf p { margin-bottom: 2rem; }
