/* ========================================
   BS CUSTOM - MOBILE RESPONSIVE 2026
   Refonte complète mobile-first moderne
   Optimisé pour Core Web Vitals & UX
   ======================================== */

/* ==================== BASE MOBILE OPTIMIZATIONS ==================== */

/* Désactiver le highlight sur touch pour tous */
@media (max-width: 980px) {
  * {
    -webkit-tap-highlight-color: transparent;
  }

  /* Empêcher le zoom auto sur les inputs iOS */
  input, select, textarea {
    font-size: 16px !important;
  }

  /* Améliorer les zones de touch - Apple recommande 44px minimum */
  a, button, input[type="button"], input[type="submit"],
  .btn, .filter-btn, .mobile-nav-item {
    min-height: 44px;
  }

  /* Texte plus lisible sur mobile */
  body {
    -webkit-text-size-adjust: 100%;
    text-rendering: optimizeLegibility;
  }

  /* Justification du texte sur mobile */
  p,
  .svc-desc,
  .hero-tagline,
  .hero-subtitle,
  .section-subtitle,
  .step-panel-desc,
  .finition-desc,
  .shop-card-desc,
  .vehicle-desc,
  .contact-line,
  .footer p,
  .gallery-head p,
  [class*="desc"],
  [class*="subtitle"],
  [class*="tagline"],
  [class*="text-content"],
  .about-text,
  .intro-text {
    text-align:left;
    text-justify: inter-word;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    hyphens: auto;
    word-break: break-word;
  }

  /* Exceptions - garder centré */
  .section-title,
  .section-title h2,
  .svc-name,
  .svc-link,
  .btn,
  .hero-word,
  h1, h2, h3, h4, h5, h6,
  .shop-card-title,
  .vehicle-name,
  .finition-title {
    text-align: center;
  }
}

/* ==================== MOBILE VARIABLES ==================== */
@media (max-width: 980px) {
  :root {
    --navH: 56px;
    --bannerH: 32px;
    --radius: 16px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --mobile-nav-height: 72px;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);

    /* Spacing mobile */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;

    /* Typography mobile */
    --text-xs: 12px;
    --text-sm: 13px;
    --text-base: 15px;
    --text-lg: 18px;
    --text-xl: 22px;
    --text-2xl: 28px;
    --text-3xl: 34px;

    /* Liquid Glass Effect */
    --glass-bg: rgba(15, 15, 15, 0.85);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(20px) saturate(180%);
  }
}

/* ==================== CONTAINER MOBILE ==================== */
@media (max-width: 980px) {
  .container {
    width: calc(100% - 32px);
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
  }
}

@media (max-width: 480px) {
  .container {
    width: calc(100% - 24px);
  }
}

/* ==================== BODY & LAYOUT ==================== */
@media (max-width: 980px) {
  body {
    padding-bottom: calc(var(--mobile-nav-height) + var(--safe-area-bottom) + 16px);
    overflow-x: hidden;
  }

  main {
    min-height: calc(100vh - var(--navH) - var(--bannerH));
  }
}

/* ==================== NAVIGATION HEADER MOBILE ==================== */
@media (max-width: 980px) {
  .nav {
    height: var(--navH);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .nav-inner {
    justify-content: center;
    gap: 12px;
  }

  .brand {
    min-width: auto;
    justify-content: center;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1.5px solid rgba(198, 169, 109, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }

  .brand-name {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.05em;
  }

  /* Cacher menu desktop */
  .menu {
    display: none !important;
  }
}

@media (max-width: 380px) {
  .brand-name {
    display: none;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }
}

/* ==================== HERO SECTION MOBILE ==================== */
@media (max-width: 980px) {
  .hero {
    min-height: 55vh;
    padding-top: calc(var(--navH) + var(--bannerH));
  }

  .hero-content {
    padding: 32px 20px 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .hero-title,
  .hero-word {
    font-size: var(--text-2xl);
    line-height: 1.15;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
  }

  .hero-word.boxed {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .hero-subtitle,
  .hero-tagline {
    font-size: var(--text-sm);
    line-height: 1.6;
    max-width: 320px;
    margin-top: 12px;
    opacity: 0.85;
  }

  .hero-mini-line {
    width: 32px;
    height: 2px;
    margin: 8px 0;
  }

  .hero-cta {
    margin-top: 20px;
    gap: 12px;
    flex-direction: column;
    width: 100%;
    max-width: 280px;
  }

  .hero-cta .btn {
    width: 100%;
    justify-content: center;
  }

  /* Hero dots */
  .hero-dots {
    bottom: 16px;
    gap: 8px;
  }

  .hero-dot {
    width: 8px;
    height: 8px;
  }
}

@media (max-width: 480px) {
  .hero {
    min-height: 50vh;
  }

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

  .hero-subtitle,
  .hero-tagline {
    font-size: 12px;
    max-width: 280px;
  }
}

@media (max-width: 380px) {
  .hero-title,
  .hero-word {
    font-size: 22px;
    letter-spacing: 0.06em;
  }
}

/* ==================== BUTTONS MOBILE - Touch Optimized ==================== */
@media (max-width: 980px) {
  .btn {
    height: 48px;
    padding: 0 24px;
    font-size: var(--text-xs);
    border-radius: var(--radius-sm);
    font-weight: 600;
    letter-spacing: 0.08em;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    will-change: transform;
  }

  .btn:active {
    transform: scale(0.97);
  }

  .btn-primary {
    box-shadow: 0 4px 16px rgba(198, 169, 109, 0.25);
  }

  .btn-primary:active {
    box-shadow: 0 2px 8px rgba(198, 169, 109, 0.2);
  }

  .btn-outline {
    border-width: 1.5px;
  }
}

/* ==================== SECTIONS MOBILE ==================== */
@media (max-width: 980px) {
  .section {
    padding: 48px 0;
  }

  .section-title h2,
  .intro h2 {
    font-size: var(--text-xl);
    line-height: 1.3;
  }

  .section-title .underline,
  .underline {
    width: 32px;
    height: 2px;
    margin-top: 10px;
  }

  .intro .copy {
    font-size: var(--text-sm);
    line-height: 1.7;
    margin-top: 16px;
  }
}

@media (max-width: 480px) {
  .section {
    padding: 40px 0;
  }

  .section-title h2,
  .intro h2 {
    font-size: var(--text-lg);
  }
}

/* ==================== SERVICES GRID MOBILE ==================== */
@media (max-width: 980px) {
  .svc-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .svc-card {
    min-height: 200px;
    border-radius: var(--radius);
    overflow: hidden;
  }

  .svc-card:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }

  .svc-card__body {
    padding: 20px;
  }

  .svc-name {
    font-size: var(--text-base);
  }

  .svc-desc {
    font-size: var(--text-sm);
    line-height: 1.5;
  }

  .svc-link {
    font-size: var(--text-xs);
    margin-top: 12px;
  }
}

/* ==================== SHOP HERO MOBILE ==================== */
@media (max-width: 980px) {
  .shop-hero {
    padding: 40px 0 16px;
  }
}

/* ==================== GALLERY GRID MOBILE ==================== */
@media (max-width: 980px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .gallery-item {
    border-radius: var(--radius-sm);
    min-height: 120px;
  }

  .gallery-item img {
    height: 140px;
  }

  .gallery-head h2 {
    font-size: var(--text-xl);
  }

  .gallery-head p {
    font-size: var(--text-xs);
    padding: 0 16px;
  }

  .gallery-cta {
    margin-top: 20px;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .gallery-item img {
    height: 120px;
  }
}

/* ==================== FOOTER MOBILE ==================== */
@media (max-width: 980px) {
  .footer {
    padding: 48px 0 32px;
  }

  .footer-divider {
    margin-bottom: 40px;
  }

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

  .footer h3 {
    font-size: var(--text-xs);
    margin-bottom: 14px;
  }

  .contact-box {
    padding: 18px;
    border-radius: var(--radius);
  }

  .contact-line {
    font-size: var(--text-sm);
    margin-top: 12px;
    gap: 12px;
  }

  .contact-ico {
    width: 18px;
    height: 18px;
  }

  .socials {
    margin: 16px 0;
    gap: 10px;
    flex-wrap: wrap;
  }

  .socials .btn {
    height: 44px;
    padding: 0 16px;
    font-size: var(--text-xs);
    flex: 1;
    min-width: 100px;
    justify-content: center;
  }

  .footer-bottom {
    margin-top: 32px;
    padding-top: 20px;
    font-size: var(--text-xs);
    text-align: center;
  }
}

/* ==================== DIVIDERS MOBILE ==================== */
@media (max-width: 980px) {
  .bs-divider {
    height: 40px;
  }
}

/* ==================== FORMS MOBILE ==================== */
@media (max-width: 980px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  input[type="search"],
  input[type="date"],
  textarea,
  select {
    height: 52px;
    padding: 0 16px;
    font-size: 16px !important; /* Prevent iOS zoom */
    border-radius: var(--radius-sm);
    border: 1.5px solid rgba(255, 255, 255, 0.28);
    background: rgba(0, 0, 0, 0.4);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
  }

  input:focus,
  textarea:focus,
  select:focus {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
    border-color: var(--gold);
    box-shadow: none;
  }

  textarea {
    height: auto;
    min-height: 120px;
    padding: 16px;
    resize: vertical;
  }

  /* Seuls les libellés de champs passent en capitales : les cases à cocher gardent leur texte. */
  label.form-label,
  .form-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
    display: block;
    color: var(--muted);
  }

  /* Form groups spacing */
  .form-group,
  [style*="margin-bottom:20px"],
  [style*="margin-bottom: 20px"] {
    margin-bottom: 20px !important;
  }
}

/* ==================== LANDSCAPE MODE ==================== */
@media (max-width: 980px) and (orientation: landscape) {
  .hero {
    min-height: 70vh;
  }

  .hero-content {
    padding: 24px 20px 32px;
  }

  .hero-title,
  .hero-word {
    font-size: var(--text-xl);
  }

  .hero-cta {
    flex-direction: row;
    max-width: none;
  }

  .hero-cta .btn {
    width: auto;
    flex: 1;
  }

  .section {
    padding: 36px 0;
  }

}

/* ==================== VERY SMALL SCREENS ==================== */
@media (max-width: 380px) {
  :root {
    --navH: 52px;
    --bannerH: 28px;
  }

  .container {
    width: calc(100% - 20px);
  }

  .btn {
    height: 46px;
    padding: 0 18px;
    font-size: 10px;
  }

  .hero {
    min-height: 48vh;
  }

  .section {
    padding: 36px 0;
  }

  .footer-grid {
    gap: 28px;
  }

  .socials .btn {
    width: 100%;
    flex: none;
  }
}

/* ==================== TABLETS (768px - 980px) ==================== */
@media (max-width: 980px) and (min-width: 768px) {
  .container {
    width: calc(100% - 48px);
  }

  .hero {
    min-height: 50vh;
  }

  .hero-title,
  .hero-word {
    font-size: var(--text-3xl);
  }

  .hero-subtitle,
  .hero-tagline {
    font-size: var(--text-sm);
    max-width: 420px;
  }

  .hero-cta {
    flex-direction: row;
    max-width: none;
  }

  .hero-cta .btn {
    width: auto;
  }

  /* Services - 2 columns on tablet */
  .svc-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  /* Grilles à 4 éléments (valeurs, prestations, aperçu boutique) : 2 colonnes, pas 3 + 1 orphelin */
  .values-grid,
  .shop-preview-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Footer - 2 columns on tablet */
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }

  /* Gallery - 3 columns on tablet */
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==================== SAFE AREA SUPPORT (iPhone Notch) ==================== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  @media (max-width: 980px) {
    body {
      padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + 16px);
    }
  }
}

/* ==================== HIGH CONTRAST MODE ==================== */
@media (max-width: 980px) and (prefers-contrast: high) {
  .btn {
    border-width: 2px;
  }

  .svc-card {
    border-width: 2px;
  }
}

/* ==================== DARK MODE ENHANCEMENTS ==================== */
@media (max-width: 980px) and (prefers-color-scheme: dark) {
  /* Already dark theme, but ensure proper contrast */
  .btn-primary {
    text-shadow: none;
  }

  input::placeholder,
  textarea::placeholder {
    opacity: 0.5;
  }
}


