/* ============================================================
   MARRAKECH DÉCORATION — responsive.css
   Full Mobile & Tablet Responsiveness
   Breakpoints: 1200px | 1024px | 768px | 480px | 360px
   ============================================================ */

/* ── GLOBAL TOUCH IMPROVEMENTS ── */
* {
  -webkit-tap-highlight-color: transparent;
}

/* On touch devices, restore normal cursor */
@media (hover: none) and (pointer: coarse) {
  body { cursor: auto; }
  #cursor, #cursor-ring { display: none; }
  a, button, .dot, .c-card, .valeur, .sf-step,
  .nav-hamburger, .lang-btn, .btn-submit,
  .gm-close, .gm-lb-arrow, .gm-mitem {
    cursor: pointer !important;
  }
}

/* Ensure full-width on all devices */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

section {
  scroll-margin-top: 90px;
}

/* ── TABLET — 1024px ── */
@media (max-width: 1024px) {
  /* Nav */
  nav {
    padding: 1.1rem 2rem;
    grid-template-columns: 1fr auto;
  }
  nav.scrolled { padding: .85rem 2rem; }
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .nav-hamburger { display: flex; }
  .nav-mobile { z-index: 700; }

  /* Histoire */
  #histoire { padding: 7rem 0; }
  .histoire-inner {
    grid-template-columns: 1fr;
    gap: 4rem;
    padding: 0 3rem;
    max-width: 100%;
  }
  .histoire-left { max-width: 520px; margin: 0 auto; }
  .histoire-img-main { aspect-ratio: 4/3; }
  .histoire-stat-badge { top: 1.5rem; right: 1.5rem; }
  .histoire-values { grid-template-columns: 1fr 1fr; }

  /* Collections */
  .collections-grid {
    padding: 0 2rem;
    gap: 3px;
  }

  /* Savoir-faire */
  .sf-inner { padding: 0 3rem; }
  .sf-header {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    margin-bottom: 3.5rem;
  }
  .sf-img-strip { grid-template-columns: repeat(2, 1fr); }
  .sf-steps { grid-template-columns: 1fr 1fr; }
  .sf-step { border-right: 1px solid var(--border-or); border-bottom: 1px solid var(--border-or); }
  .sf-step:nth-child(2n) { border-right: none; }
  .sf-step:last-child { border-bottom: none; }

  /* Testimonials */
  .temoignages-inner {
    grid-template-columns: 1fr;
    gap: 4rem;
    padding: 0 3rem;
  }
  .temoignages-left { max-width: 420px; margin: 0 auto; }

  /* Contact */
  .contact-inner {
    grid-template-columns: 1fr;
    gap: 4rem;
    padding: 0 3rem;
  }

  /* Footer */
  footer {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 3rem 2rem;
    gap: 1.5rem;
  }
  .footer-right { text-align: center; }
  .footer-left { text-align: center; }
}

/* ── MOBILE LARGE — 768px ── */
@media (max-width: 768px) {

  /* ── Navigation ── */
  nav {
    padding: 1rem 1.5rem;
    grid-template-columns: 1fr auto;
  }
  nav.scrolled { padding: .8rem 1.5rem; }
  .logo-img { height: 32px; }
  nav.scrolled .logo-img { height: 28px; }
  .nav-links, .nav-cta { display: none; }
  .nav-hamburger { display: flex; }

  /* Nav right: hide "contacter" CTA, show only lang + hamburger */
  .nav-right {
    gap: .6rem;
  }
  .lang-btn {
    min-height: 34px;
    min-width: 34px;
  }
  .nav-hamburger {
    min-height: 40px;
    min-width: 40px;
    justify-content: center;
    align-items: center;
  }

  /* Mobile menu improvements */
  .nav-mobile {
    padding: 2rem 1.5rem;
    gap: 1.8rem;
    z-index: 700;
    pointer-events: none;
  }
  .nav-mobile.open { pointer-events: all; }
  .nav-mobile a {
    font-size: 1.1rem;
    letter-spacing: .18em;
    padding: .35rem 0;
    touch-action: manipulation;
  }

  /* ── Hero ── */
  #hero {
    min-height: 100svh;
    padding: 0 1.5rem;
  }
  .hero-content {
    padding: 0 1rem;
    max-width: 100%;
  }
  .hero-eyebrow {
    font-size: .58rem;
    letter-spacing: .35em;
    margin-bottom: 1.4rem;
  }
  .hero-eyebrow::before,
  .hero-eyebrow::after { margin: 0 .6rem; }
  .hero-title {
    font-size: clamp(2.4rem, 9vw, 4.5rem);
  }
  .hero-subtitle {
    font-size: clamp(1rem, 3.5vw, 1.4rem);
    margin: 1rem 0 2rem;
  }
  .hero-collections {
    font-size: .65rem;
    letter-spacing: .16em;
    margin-bottom: 2.5rem;
  }
  .hero-btn {
    padding: 1rem 2.5rem;
    font-size: .62rem;
  }
  .hero-year { display: none; }
  .hero-divider .dline { width: 50px; }
  .geo-ring:nth-child(1) { width: 340px; height: 340px; }
  .geo-ring:nth-child(2) { width: 220px; height: 220px; }
  .geo-ring:nth-child(3) { width: 130px; height: 130px; }

  /* ── Marquee ── */
  .marquee-band { padding: .65rem 0; }
  .marquee-item { font-size: .56rem; padding: 0 1.5rem; letter-spacing: .22em; }

  /* ── Histoire ── */
  #histoire { padding: 5rem 0; }
  .histoire-inner {
    padding: 0 1.5rem;
    gap: 3rem;
    grid-template-columns: 1fr;
  }
  .histoire-left { max-width: 100%; }
  .histoire-img-main {
    aspect-ratio: 3/4;
    max-height: 420px;
  }
  .histoire-img-main::before,
  .histoire-img-main::after { display: none; }
  .histoire-stat-badge {
    width: 90px;
    height: 90px;
    top: 1rem;
    right: 1rem;
  }
  .histoire-stat-badge .s-num { font-size: 1.6rem; }
  .histoire-stat-badge .s-lab { font-size: .38rem; }
  .histoire-title { font-size: clamp(1.8rem, 6vw, 2.8rem); margin-bottom: 1.4rem; }
  .histoire-text { font-size: .84rem; line-height: 2; margin-bottom: 1.4rem; }
  .histoire-quote { padding: 1.1rem 1.4rem; margin: 1.8rem 0; }
  .histoire-quote p { font-size: 1.15rem; }
  .histoire-values {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 2rem;
  }
  .valeur { padding: 1.2rem 1.4rem; }

  /* ── Collections ── */
  #collections { padding: 5rem 0; }
  .collections-header {
    padding: 0 1.5rem;
    margin-bottom: 3rem;
  }
  .collections-title { font-size: clamp(1.8rem, 7vw, 3rem); }
  .collections-intro { font-size: .82rem; }
  .collections-grid {
    grid-template-columns: 1fr;
    padding: 0;
    gap: 2px;
  }
  .c-card { aspect-ratio: 3/4; }
  /* Always show card content on mobile (no hover) */
  .c-card-content {
    transform: translateY(0);
    padding: 2rem 1.5rem;
  }
  .c-card-desc {
    opacity: 1;
    transform: translateY(0);
    max-width: 100%;
    font-size: .75rem;
  }
  .c-card-cta {
    opacity: 1;
    transform: translateY(0);
  }
  .c-card-title { font-size: 1.7rem; }

  /* ── Savoir-faire ── */
  #savoir-faire { padding: 5rem 0; }
  .sf-inner { padding: 0 1.5rem; }
  .sf-header {
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2.5rem;
  }
  .sf-title { font-size: clamp(1.8rem, 6vw, 3rem); }
  .sf-img-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
  }
  .sf-img-strip-item { aspect-ratio: 1/1; }
  .sf-steps {
    grid-template-columns: 1fr;
    border: none;
  }
  .sf-step {
    border-right: none !important;
    border-bottom: 1px solid var(--border-or) !important;
    padding: 2rem 1.5rem;
  }
  .sf-step:last-child { border-bottom: none !important; }
  .sf-step-num { font-size: 2.4rem; margin-bottom: 1rem; }

  /* ── Testimonials ── */
  #temoignages { padding: 5rem 0; }
  .temoignages-inner {
    padding: 0 1.5rem;
    gap: 2.5rem;
    grid-template-columns: 1fr;
  }
  .temoignages-left { display: none; } /* Hide image on small mobile to save space */
  .temoignages-right { text-align: left; }
  .temoignages-ornament { font-size: 4rem; margin-bottom: 1.2rem; }
  .temoignage-text { font-size: clamp(1.1rem, 4vw, 1.6rem); }
  #temo-title { font-size: clamp(1.7rem, 6vw, 2.5rem) !important; margin-bottom: 1.5rem !important; }

  /* ── Contact ── */
  #contact { padding: 5rem 0; }
  .contact-inner {
    grid-template-columns: 1fr;
    gap: 3.5rem;
    padding: 0 1.5rem;
  }
  .contact-title { font-size: clamp(1.8rem, 6vw, 2.8rem); }
  .contact-map-ph { margin-bottom: 1.8rem; }
  .contact-map-ph iframe { width: 100% !important; border-radius: 16px !important; }
  .f-row { grid-template-columns: 1fr; gap: 0; }
  .f-group input,
  .f-group textarea,
  .f-group select {
    font-size: 16px; /* Prevents iOS zoom on focus */
    padding: .85rem 1rem;
  }
  .f-group textarea { min-height: 110px; }
  .btn-submit { padding: 1.1rem; font-size: .62rem; }

  /* ── Footer ── */
  footer {
    padding: 2.5rem 1.5rem;
    gap: 1.2rem;
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-logo-img { height: 40px; }
  .footer-left,
  .footer-right { text-align: center; font-size: .65rem; }

  /* ── Gallery modal ── */
  .gm-overlay { align-items: flex-end; }
  .gm-panel {
    width: 100vw;
    max-height: 92dvh;
    border-radius: 16px 16px 0 0;
    border-bottom: none;
  }
  .gm-overlay.gm-open .gm-panel { transform: translateY(0) scale(1); }
  .gm-header { padding: 1.5rem 1.25rem 1rem; }
  .gm-masonry {
    column-count: 2;
    padding: .85rem .85rem 1rem;
    column-gap: .4rem;
  }
  .gm-mitem { margin-bottom: .4rem; }
  .gm-desc { display: none; }
  .gm-lb-arrow { width: 38px; height: 38px; font-size: 1.4rem; }
}

/* ── MOBILE SMALL — 480px ── */
@media (max-width: 480px) {
  /* Nav */
  nav { padding: .9rem 1.2rem; }
  .logo-img { height: 28px; }
  .lang-btn { font-size: .48rem; padding: .22rem .5rem; }
  .lang-sep { display: none; }
  section { scroll-margin-top: 80px; }

  /* Hero */
  .hero-title { font-size: clamp(2rem, 11vw, 3.2rem); }
  .hero-eyebrow { font-size: .52rem; letter-spacing: .25em; }
  .hero-subtitle { font-size: clamp(.9rem, 4vw, 1.2rem); }
  .hero-btn { padding: .9rem 2rem; font-size: .58rem; letter-spacing: .22em; }
  .hero-divider { gap: .6rem; }
  .hero-divider .dline { width: 35px; }
  .hero-scroll { bottom: 1.5rem; }
  .scroll-bar { height: 38px; }

  /* Histoire */
  .histoire-img-main { aspect-ratio: 1/1; max-height: 360px; }
  .histoire-inner { padding: 0 1.2rem; }

  /* Collections */
  .c-card { aspect-ratio: 4/5; }
  .c-card-title { font-size: 1.5rem; }
  .c-card-content { padding: 1.5rem 1.2rem; }

  /* Savoir-faire */
  .sf-inner { padding: 0 1.2rem; }
  .sf-img-strip { grid-template-columns: repeat(2, 1fr); }

  /* Testimonials */
  .temoignages-inner { padding: 0 1.2rem; }

  /* Contact */
  .contact-inner { padding: 0 1.2rem; }
  .contact-social { gap: .8rem; }
  .social-btn { width: 40px; height: 40px; font-size: .68rem; }

  /* Footer */
  footer { padding: 2rem 1.2rem; }
  .footer-logo-img { height: 36px; }

  /* Gallery */
  .gm-masonry { column-count: 2; }
  .gm-lb-arrow { width: 34px; height: 34px; font-size: 1.2rem; }
}

/* ── MOBILE XS — 360px ── */
@media (max-width: 360px) {
  nav { padding: .8rem 1rem; }
  .logo-img { height: 24px; }

  .hero-title { font-size: clamp(1.8rem, 12vw, 2.8rem); }
  .hero-collections { font-size: .58rem; letter-spacing: .12em; }
  .hero-btn { padding: .85rem 1.7rem; font-size: .55rem; }

  .histoire-inner,
  .sf-inner,
  .temoignages-inner,
  .contact-inner { padding: 0 1rem; }

  .c-card-title { font-size: 1.35rem; }

  .contact-map-ph iframe { height: 200px !important; }

  footer { padding: 1.8rem 1rem; }
}

/* ── LANDSCAPE MOBILE ── */
@media (max-width: 768px) and (orientation: landscape) {
  #hero {
    min-height: 100vw;
    padding-top: 4rem;
    align-items: flex-start;
    padding-top: 5rem;
  }
  .hero-content { padding: 0 2rem; }
  .hero-title { font-size: clamp(2rem, 6vw, 3.5rem); }
  .hero-scroll { display: none; }
  .geo-ring:nth-child(1) { width: 260px; height: 260px; }
  .geo-ring:nth-child(2) { width: 180px; height: 180px; }
  .geo-ring:nth-child(3) { width: 100px; height: 100px; }
}

/* ── LARGE DESKTOP — 1440px+ ── */
@media (min-width: 1440px) {
  .collections-grid { max-width: 1600px; }
  .histoire-inner,
  .contact-inner,
  .sf-inner,
  .temoignages-inner { max-width: 1400px; }
}

/* ── TOUCH: Always show collection card content ── */
@media (hover: none) {
  .c-card-content { transform: translateY(0) !important; }
  .c-card-desc { opacity: 1 !important; transform: none !important; }
  .c-card-cta { opacity: 1 !important; transform: none !important; }
  .c-card-img { transform: none !important; }
  .c-card-shimmer { display: none; }

  /* Disable hover animations that won't trigger on touch */
  .valeur:hover { transform: none; }
  .histoire-img-main:hover { transform: none; }
}

/* ── SAFE AREA INSETS (iPhone notch/Dynamic Island) ── */
@supports (padding: env(safe-area-inset-bottom)) {
  nav {
    padding-left: max(1.5rem, env(safe-area-inset-left));
    padding-right: max(1.5rem, env(safe-area-inset-right));
  }
  footer {
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
  }
  .nav-mobile {
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
  }
  .gm-panel {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ── IMPROVED SCROLLING ── */
.gm-masonry {
  -webkit-overflow-scrolling: touch;
}

/* ── RTL Mobile Fixes ── */
@media (max-width: 768px) {
  body.rtl .histoire-inner,
  body.rtl .temoignages-inner,
  body.rtl .contact-inner { flex-direction: column; grid-template-columns: 1fr; }
  body.rtl .section-label { justify-content: flex-start; }
  body.rtl #temo-section-label { justify-content: flex-start; }
  body.rtl .temoignages-right { text-align: right; }
  body.rtl .contact-social { justify-content: flex-start; }
}
