/* OTO Mobile Optimization · 2026-08-03 · calibre responsive pour smartphones */

/* Base · font smoothing + touch */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

/* Touch targets · min 44x44 (Apple HIG + WCAG AA) */
button, a.btn, [role='button'], input[type='submit'], input[type='button'] {
  min-height: 44px;
  min-width: 44px;
  touch-action: manipulation;
}

/* Inputs · pas de zoom iOS Safari */
input[type='text'], input[type='email'], input[type='tel'], input[type='number'], input[type='password'], input[type='search'], select, textarea {
  font-size: 16px !important;
}

/* Widget devise + langue · plus discret mobile */
@media (max-width: 640px) {
  #otov7-switch-host {
    top: 12px !important;
    right: 8px !important;
    scale: 0.85;
    transform-origin: top right;
  }
}

/* Concierge silhouette · plus petit + plus proche du coin en mobile */
@media (max-width: 640px) {
  #otov7-concierge-icon-host img {
    width: 68px !important;
    height: 68px !important;
  }
}

/* Modal contact · padding responsive */
@media (max-width: 640px) {
  .contact-modal, [data-role='bg'] .modal {
    padding: 20px 16px !important;
    max-height: 92vh !important;
    border-radius: 12px 12px 0 0 !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Hero titles · responsive fluide */
@media (max-width: 640px) {
  h1, .hero-title, .sec__title {
    font-size: clamp(32px, 8vw, 48px) !important;
    line-height: 1.05 !important;
  }
  h2, .sec-title {
    font-size: clamp(22px, 6vw, 32px) !important;
  }
  h3 {
    font-size: clamp(18px, 5vw, 24px) !important;
  }
  p, .body-text {
    font-size: 15px !important;
    line-height: 1.6 !important;
  }
}

/* Sections plein écran · pad plus généreux mobile */
@media (max-width: 640px) {
  .sec, section {
    padding: 40px 20px !important;
  }
  .sec__content {
    padding: 20px !important;
  }
}

/* Grid 2/3/4 cols · stack mobile */
@media (max-width: 640px) {
  .grid2, .grid-2 {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .grid3, .grid-3, [style*='grid-template-columns:repeat(3'] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  [style*='grid-template-columns:2fr'] {
    grid-template-columns: 1fr !important;
  }
}

/* Portail /mon-compte/ tabs · scroll horizontal mobile */
@media (max-width: 768px) {
  .tabs, [role='tablist'] {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    flex-wrap: nowrap !important;
    scroll-snap-type: x mandatory !important;
  }
  .tabs .tab, [role='tab'] {
    scroll-snap-align: start !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }
  .panel {
    padding: 20px 16px !important;
    margin-bottom: 16px !important;
  }
  .row {
    grid-template-columns: 1fr !important;
    gap: 4px 0 !important;
    padding: 12px 0 !important;
  }
  .row .lbl {
    font-size: 11px !important;
    color: var(--gold);
    margin-bottom: 2px !important;
  }
}

/* Bandeau pré-commercialisation · texte plus petit mobile */
@media (max-width: 640px) {
  #otov7-waitlist-host .bar {
    padding: 14px 16px !important;
    font-size: 13px !important;
  }
}

/* OTO LIVING™ Smart Home · grid stack mobile */
@media (max-width: 640px) {
  #oto-living-host .grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
}

/* Footer · colonnes stack mobile */
@media (max-width: 768px) {
  footer [style*='grid-template-columns:2fr 1fr 1fr 1fr'] {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
}

/* CTA fin de page · plus compact mobile */
@media (max-width: 640px) {
  #cta-contact-fin {
    padding: 60px 20px !important;
  }
  #cta-contact-fin h2 {
    font-size: clamp(26px, 7vw, 40px) !important;
  }
  #cta-contact-fin button,
  #cta-contact-fin .cta-actions a {
    padding: 16px 32px !important;
    font-size: 12px !important;
  }
  #cta-contact-fin .cta-actions {
    gap: 12px !important;
  }
  #cta-contact-fin .cta-actions a {
    flex: 1 1 240px;
    text-align: center;
  }
}

/* Cookies bannière v2 · adapté mobile */
@media (max-width: 640px) {
  #otov7-cookies-host-v2 .wrap {
    padding: 14px 16px !important;
  }
  #otov7-cookies-host-v2 .title {
    font-size: 16px !important;
  }
  #otov7-cookies-host-v2 .body {
    font-size: 12px !important;
  }
  #otov7-cookies-host-v2 .btn {
    padding: 10px 14px !important;
    font-size: 11px !important;
  }
}

/* Prévention scroll horizontal accidentel */
body, html {
  overflow-x: hidden !important;
}
* {
  max-width: 100vw !important;
  box-sizing: border-box !important;
}

/* Images responsive par défaut */
img {
  max-width: 100%;
  height: auto;
}

/* Vidéos responsive */
video, iframe {
  max-width: 100%;
}

/* Formulaires mobile · full width */
@media (max-width: 640px) {
  input, select, textarea {
    width: 100% !important;
    max-width: 100% !important;
  }
  form .grid2 {
    grid-template-columns: 1fr !important;
  }
}

/* Safe area iOS (notch) */
@supports (padding-top: env(safe-area-inset-top)) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

/* Skip link · centrer au focus mobile */
@media (max-width: 640px) {
  .skip-link:focus {
    left: 50% !important;
    transform: translateX(-50%);
    top: 8px !important;
  }
}
