/* =========================================================
   Responsive — Électricité Natola
   Version propre + correctif scroll horizontal
   + correctif superposition mobile
   + menu clair automatique
   + correctif calendrier RDV mobile
   ========================================================= */


/* =========================================================
   Sécurité globale anti-débordement horizontal
   ========================================================= */

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  position: relative;
}

img,
video,
svg,
canvas {
  max-width: 100%;
  height: auto;
}

.container,
.nav-shell,
.hero,
.hero-grid,
.hero-visual,
.section,
.page-title,
.site-footer {
  max-width: 100%;
}

.hero,
.hero-visual,
.section,
.page-title {
  overflow-x: hidden;
}


/* =========================================================
   Tablette / petit écran
   ========================================================= */

@media (max-width: 980px) {

  .nav-shell {
    width: min(var(--max), calc(100% - 40px));
  }

  .nav-menu {
    position: fixed;
    top: 92px;
    left: 20px;
    right: 20px;
    width: auto;
    max-width: calc(100vw - 40px);

    display: none;
    flex-direction: column;
    align-items: stretch;

    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 26px;

    background: rgba(7, 17, 13, 0.96);
    backdrop-filter: blur(24px);
    box-shadow: 0 20px 65px rgba(0, 0, 0, 0.35);
    z-index: 999;
  }

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

  .nav-menu a {
    padding: 15px 16px;
  }

  .menu-toggle {
    display: block;
  }

  .hero {
    padding-top: 130px;
  }

  .hero-grid,
  .split,
  .form-shell {
    display: grid;
    grid-template-columns: 1fr;
  }

  .form-shell {
    gap: 26px;
    width: 100%;
  }

  .hero-visual {
    min-height: 500px;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
  }

  .energy-orb {
    max-width: 92vw;
  }

  .circuit-card.main {
    right: 0;
    width: min(390px, calc(100vw - 40px));
    max-width: calc(100vw - 40px);
  }

  .circuit-card.small {
    max-width: calc(100vw - 40px);
  }

  .floating-badge {
    max-width: calc(100vw - 40px);
  }

  .grid-3,
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .calendar-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .kicker {
    max-width: 100%;
    flex-wrap: wrap;
    overflow-wrap: anywhere;
  }
}


/* =========================================================
   Mode clair automatique — menu mobile
   ========================================================= */

@media (prefers-color-scheme: light) and (max-width: 980px) {

  .nav-menu {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(7, 17, 13, 0.13);
    box-shadow: 0 20px 65px rgba(7, 17, 13, 0.14);
  }

  .nav-menu a {
    color: rgba(7, 17, 13, 0.82);
  }

  .nav-menu a:hover,
  .nav-menu a.is-active {
    background: rgba(7, 17, 13, 0.07);
    color: var(--text-main);
  }

  .nav-cta {
    color: #031108 !important;
    background: var(--green-electric) !important;
  }

  .menu-toggle {
    background: rgba(7, 17, 13, 0.08);
    color: var(--text-main);
  }

  .menu-toggle span {
    background: currentColor;
  }
}


/* =========================================================
   Mobile large / tablette portrait
   ========================================================= */

@media (max-width: 720px) {

  .container,
  .nav-shell {
    width: min(var(--max), calc(100% - 26px));
  }

  .section {
    padding: 68px 0;
  }

  .page-title {
    padding-top: 132px;
  }

  h1 {
    font-size: clamp(2.55rem, 14vw, 4.4rem);
    overflow-wrap: anywhere;
  }

  h2 {
    font-size: clamp(2rem, 10vw, 3.2rem);
    overflow-wrap: anywhere;
  }

  .brand {
    min-width: 0;
  }

  .brand-text {
    min-width: 0;
  }

  .brand-text small {
    display: none;
  }

  .hero-grid {
    gap: 28px;
  }

  .hero-stats,
  .grid-3,
  .grid-2,
  .gallery-grid,
  .form-row,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    position: relative;
    isolation: isolate;

    display: flex;
    flex-direction: column;
    gap: 16px;

    width: 100%;
    max-width: 100%;
    min-height: auto;

    padding: 64px 0 20px;
    overflow: visible;
  }

  .energy-orb {
    position: absolute;
    top: 0;
    left: 50%;
    right: auto;

    width: min(92vw, 520px);
    max-width: 92vw;

    animation: none;
    transform: translateX(-50%) !important;

    z-index: 0;
    opacity: 0.78;
    pointer-events: none;
  }

  .circuit-card.main,
  .circuit-card.small,
  .floating-badge {
    position: relative;

    top: auto;
    right: auto;
    bottom: auto;
    left: auto;

    width: 100%;
    max-width: 100%;

    transform: none !important;
    z-index: 1;
  }

  .circuit-card.main,
  .circuit-card.small {
    padding: 22px;
  }

  .floating-badge {
    display: block;
    padding: 18px;
    margin-top: 0;
  }

  .card {
    padding: 23px;
  }

  .btn {
    width: 100%;
  }

  .btn-row {
    align-items: stretch;
  }

  .kicker {
    gap: 12px;
    line-height: 1.4;
    letter-spacing: 0.12em;
  }

  .kicker::before {
    width: 42px;
    flex: 0 0 42px;
  }
}


/* =========================================================
   Correctif mobile — page rendez-vous / calendrier
   ========================================================= */

@media (max-width: 768px) {

  .form-shell {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 24px;
    width: 100%;
    max-width: 100%;
    overflow: visible !important;
  }

  .form-card {
    display: block !important;
    width: 100%;
    max-width: 100%;
    overflow: visible !important;
  }

  .booking-widget {
    display: block !important;
    width: 100%;
    max-width: 100%;
    overflow: visible !important;
  }

  .booking-widget h2,
  .booking-widget h3 {
    width: 100%;
    max-width: 100%;
  }

  .booking-month-nav {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin: 18px 0;
  }

  .booking-month-title {
    flex: 1;
    text-align: center;
    font-size: 1rem;
    text-transform: capitalize;
  }

  .booking-month-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    cursor: pointer;
  }

  .booking-month-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
  }

  .calendar-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    max-width: 100%;
    min-height: 80px;
    overflow: visible !important;
  }

  .day-card {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    min-height: 92px;
    width: 100%;
    max-width: 100%;
    padding: 14px;
    border-radius: 18px;
    text-align: left;
    white-space: normal;
  }

  .day-card.empty {
    display: none !important;
  }

  .day-card .weekday,
  .day-card .date,
  .day-card .availability-label {
    display: block;
    width: 100%;
  }

  .slot-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    max-width: 100%;
    min-height: 48px;
    overflow: visible !important;
  }

  .slot-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    width: 100%;
    max-width: 100%;
    border-radius: 999px;
  }

  .form-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 16px;
    width: 100%;
    max-width: 100%;
    overflow: visible !important;
  }

  .form-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 16px;
    width: 100%;
    max-width: 100%;
  }

  .form-grid label,
  .form-grid input,
  .form-grid select,
  .form-grid textarea,
  .form-grid button {
    width: 100%;
    max-width: 100%;
  }

  .form-grid input,
  .form-grid select,
  .form-grid textarea {
    box-sizing: border-box;
  }

  .form-grid textarea {
    min-height: 140px;
  }

  .checkbox {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
  }

  .checkbox input {
    width: auto !important;
    max-width: none !important;
    margin-top: 4px;
    flex: 0 0 auto;
  }

  .checkbox span {
    flex: 1;
  }

  .form-message,
  .booking-empty {
    display: block !important;
    width: 100%;
    max-width: 100%;
  }

  .honey {
    display: none !important;
  }
}


/* =========================================================
   Petit mobile
   ========================================================= */

@media (max-width: 430px) {

  .container,
  .nav-shell {
    width: calc(100% - 24px);
    max-width: calc(100vw - 24px);
  }

  .nav-shell {
    min-height: 66px;
    border-radius: 24px;
    padding: 9px 10px 9px 12px;
  }

  .nav-menu {
    top: 86px;
    left: 12px;
    right: 12px;
    max-width: calc(100vw - 24px);
  }

  .brand-mark {
    --logo-size: 46px;

    width: var(--logo-size);
    height: var(--logo-size);
    flex: 0 0 var(--logo-size);
  }

  .brand-text {
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .menu-toggle {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }

  .hero {
    padding-top: 118px;
  }

  .hero-visual {
    min-height: auto;
    padding-top: 48px;
    overflow: visible;
  }

  .circuit-card.main,
  .circuit-card.small,
  .floating-badge {
    width: 100%;
    max-width: 100%;
  }

  .calendar-grid,
  .slot-grid {
    grid-template-columns: 1fr !important;
  }

  .day-card {
    min-height: 82px;
  }

  .booking-month-title {
    font-size: 0.95rem;
  }

  .kicker {
    font-size: 0.72rem;
    letter-spacing: 0.10em;
  }

  .kicker::before {
    width: 34px;
    flex: 0 0 34px;
  }
}


/* =========================================================
   Très petit écran
   ========================================================= */

@media (max-width: 360px) {

  .brand-text {
    max-width: 170px;
  }

  .brand-mark {
    --logo-size: 42px;

    width: var(--logo-size);
    height: var(--logo-size);
    flex: 0 0 var(--logo-size);
  }

  .nav-shell {
    gap: 8px;
  }

  h1 {
    font-size: clamp(2.25rem, 15vw, 3.6rem);
  }

  h2 {
    font-size: clamp(1.8rem, 11vw, 2.8rem);
  }
}


/* =========================================================
   Accessibilité — réduction des animations
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation: none !important;
    scroll-behavior: auto !important;
    transition: none !important;
  }
}