/* ================================================================
   RESPONSIVE FIXES GLOBAUX - LicenceTaxi.fr
   Fix débordements, touch targets, layout iPhone
   À ajouter sur TOUTES les pages
   ================================================================ */

/* ============== RESET PROBLÈMES MOBILE ============== */
html, body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
  -webkit-text-size-adjust: 100% !important;
  -ms-text-size-adjust: 100% !important;
}

* {
  -webkit-tap-highlight-color: transparent !important;
  max-width: 100% !important;
}

/* Images jamais débordantes */
img, video, iframe {
  max-width: 100% !important;
  height: auto !important;
}

/* Tables responsives */
table {
  max-width: 100% !important;
  overflow-x: auto !important;
  display: block !important;
}

/* ============== TOUCH TARGETS (Apple HIG = 44px min) ============== */
@media (max-width: 899px) {
  button,
  a.lt-btn,
  a.lt-btn-header,
  a.cat-btn-primary,
  a.ctr-btn-primary,
  a.dash-btn,
  input[type="submit"],
  input[type="button"],
  .lt-fab-deposer {
    min-height: 44px !important;
  }
  
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  input[type="number"],
  select,
  textarea {
    min-height: 44px !important;
    font-size: 16px !important; /* évite zoom iOS */
  }
}

/* ============== PADDING SAFE AREA iPhone ============== */
body {
  padding-left: env(safe-area-inset-left) !important;
  padding-right: env(safe-area-inset-right) !important;
}

/* FAB doit respecter safe-area en bas */
.lt-fab-deposer {
  bottom: calc(24px + env(safe-area-inset-bottom)) !important;
  right: calc(20px + env(safe-area-inset-right)) !important;
}

/* ============== CONTAINER MAX-WIDTH ============== */
@media (max-width: 600px) {
  .container,
  .lt-hero-inner,
  .ltx-inner,
  .cat-hero-inner,
  .ctr-hero-inner,
  .dash-main,
  .lt-section-header {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}

/* ============== POLICES LISIBLES ============== */
@media (max-width: 480px) {
  body { font-size: 15px !important; line-height: 1.5 !important; }
  h1 { font-size: clamp(24px, 7vw, 32px) !important; line-height: 1.15 !important; }
  h2 { font-size: clamp(20px, 5.5vw, 28px) !important; line-height: 1.2 !important; }
  h3 { font-size: clamp(17px, 4.5vw, 22px) !important; line-height: 1.25 !important; }
}

/* ============== FIX HORIZONTAL SCROLL ============== */
.lt-hero,
.cat-hero,
.ctr-hero,
.lt-vedette-section,
.lt-map-section,
.lt-autres-section,
.lt-narrative-section,
.lt-stats-band,
.cat-listings,
.ctr-articles,
section,
.dash-main {
  overflow-x: hidden !important;
}

/* ============== GRILLES NE DÉBORDENT JAMAIS ============== */
.cat-grid,
.lt-autres-grid,
.lt-stats-inner,
.favoris-grid,
.recherches-list {
  width: 100% !important;
}

/* Toute carte clickable garde un padding minimum */
@media (max-width: 480px) {
  .cat-card,
  .lt-vedette-card,
  .lt-mini-card,
  .lt-autre-mini,
  .favori-card,
  .recherche-card {
    padding: 16px !important;
  }
}

/* ============== HEADERS IMAGES (logos) ============== */
header.ltx-header .ltx-logo img,
header.lt-header .lt-logo img {
  max-height: 50px !important;
  height: auto !important;
  width: auto !important;
  object-fit: contain !important;
}

/* ============== SCROLL SMOOTH ============== */
html {
  scroll-behavior: smooth !important;
}

/* ============== FORM ACCESSIBILITY ============== */
@media (max-width: 600px) {
  input, select, textarea {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Prévient le zoom iOS sur les inputs */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  input[type="search"],
  input[type="number"],
  input[type="url"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* ============== FIX LANDING SECTIONS PADDING ============== */
@media (max-width: 600px) {
  .lt-hero { padding: 30px 16px 40px !important; }
  .cat-hero { padding: 40px 16px 30px !important; }
  .ctr-hero { padding: 50px 16px 40px !important; }
  .ctr-articles { padding: 40px 16px !important; }
  .lt-stats-band { padding: 36px 16px !important; }
  .cat-listings { padding: 30px 16px 50px !important; }
}

/* ============== MENU OUVERT : Empêche scroll body ============== */
body.lt-menu-open {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
}

/* ============== CARTES NE DÉPASSENT JAMAIS ============== */
@media (max-width: 480px) {
  .lt-vedette-layout,
  .cat-grid,
  .lt-autres-grid,
  .favoris-grid,
  .recherches-list,
  .ctr-articles-grid {
    grid-template-columns: 1fr !important;
    width: 100% !important;
  }
}
