/* ═══════════════════════════════════════════════════════
   JONAS PARFUMS — MOBILE IMPROVEMENTS
   Inspired by Diptyque, Jo Malone, Le Labo
   ═══════════════════════════════════════════════════════ */

/* ——— MOBILE MEGA MENU ——— */
@media (max-width: 1024px) {
  /* Cacher le mega menu desktop, utiliser hamburger */
  .nav__item .mega-menu {
    display: none !important;
  }

  /* Mobile menu amélioré - fullscreen overlay */
  .mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height */
    background: var(--white);
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-menu.active {
    transform: translateX(0);
  }

  /* Header mobile menu */
  .mobile-menu__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.5rem;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 10;
  }

  .mobile-menu__logo {
    font-family: var(--f-disp);
    font-size: 18px;
    font-weight: 400;
    letter-spacing: 0.2em;
    color: var(--ink);
    text-transform: uppercase;
  }

  .mobile-menu__close {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ink);
    font-size: 24px;
    line-height: 1;
  }

  /* Navigation items */
  .mobile-menu > ul {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .mobile-menu > ul > li {
    border-bottom: 1px solid var(--line);
  }

  .mobile-menu > ul > li > a {
    display: block;
    padding: 1.2rem 1.5rem;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--ink);
    text-decoration: none;
    transition: background 0.2s, padding-left 0.2s;
    position: relative;
  }

  .mobile-menu > ul > li > a:active {
    background: rgba(0,0,0,0.03);
  }

  /* Sous-sections avec accordion */
  .mobile-menu__section {
    border-bottom: 1px solid var(--line);
  }

  .mobile-menu__section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 1.5rem;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--ink);
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    position: relative;
  }

  .mobile-menu__section-title::after {
    content: '+';
    font-size: 20px;
    font-weight: 300;
    transition: transform 0.3s;
  }

  .mobile-menu__section-title.active::after {
    transform: rotate(45deg);
  }

  .mobile-menu__section-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: rgba(0,0,0,0.01);
  }

  .mobile-menu__section-content.active {
    max-height: 1000px;
  }

  .mobile-menu__section-content a {
    display: block;
    padding: 0.9rem 1.5rem 0.9rem 2.5rem;
    font-size: 14px;
    color: var(--mid);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
  }

  .mobile-menu__section-content a:active {
    background: rgba(0,0,0,0.03);
    color: var(--ink);
  }

  /* Language switcher mobile */
  .mobile-menu__lang {
    padding: 2rem 1.5rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
  }

  .mobile-menu__lang-btn {
    min-width: 60px;
    padding: 0.7rem 1.2rem;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.1em;
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--mid);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
  }

  .mobile-menu__lang-btn.active {
    background: var(--ink);
    color: var(--white);
    border-color: var(--ink);
  }
}

/* ——— PRODUCT GRIDS — MOBILE OPTIMIZED ——— */
@media (max-width: 768px) {
  /* Collection grid - 1 colonne sur mobile */
  .collection-grid {
    grid-template-columns: 1fr !important;
    gap: 3rem !important;
    padding: 0 1.5rem !important;
  }

  /* Product cards plus grandes et aérées */
  .product-detail-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .product-detail-card__media {
    aspect-ratio: 3/4 !important;
    min-height: 400px;
    border-radius: 8px;
    overflow: hidden;
  }

  .product-detail-card__info {
    padding: 0 !important;
  }

  .product-card__name {
    font-size: 24px !important;
    margin: 0.5rem 0 1rem !important;
  }

  .product-card__desc {
    font-size: 14px !important;
    line-height: 1.7 !important;
    margin-bottom: 1.2rem !important;
  }

  /* Boutons touch-friendly */
  .btn,
  .size-btn,
  .filter-bar__cat {
    min-height: 48px !important;
    padding: 0.9rem 1.5rem !important;
    font-size: 14px !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .btn--add {
    min-height: 52px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
  }

  /* Product sizes mobile */
  .product-sizes {
    gap: 0.8rem !important;
    margin: 1.2rem 0 !important;
  }

  .size-btn {
    flex: 1;
    min-width: 0;
  }

  /* Notes pills plus lisibles */
  .product-detail-card__notes {
    gap: 0.6rem !important;
    margin: 1rem 0 1.5rem !important;
  }

  .note-pill {
    padding: 0.5rem 1rem !important;
    font-size: 12px !important;
  }
}

/* ——— FILTER BAR MOBILE ——— */
@media (max-width: 768px) {
  .filter-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    padding: 0 !important;
  }

  .filter-bar__cats {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding: 0.8rem 1rem !important;
    gap: 0.6rem !important;
    scrollbar-width: none; /* Firefox */
  }

  .filter-bar__cats::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
  }

  .filter-bar__cat {
    flex-shrink: 0;
    scroll-snap-align: start;
    white-space: nowrap;
    padding: 0.7rem 1.2rem !important;
    font-size: 13px !important;
    min-height: 42px !important;
  }
}

/* ——— NAVIGATION STICKY MOBILE ——— */
@media (max-width: 768px) {
  .nav {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  }

  .nav__left .nav__items,
  .nav__right .nav__items {
    display: none !important;
  }

  .nav__hamburger {
    display: flex !important;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
  }

  .nav__hamburger span {
    width: 20px;
    height: 2px;
  }

  .nav__logo-name {
    font-size: 18px !important;
  }

  .nav__logo-sub {
    font-size: 8px !important;
  }

  .nav__icon-btn {
    width: 44px !important;
    height: 44px !important;
  }
}

/* ——— HERO MOBILE ——— */
@media (max-width: 768px) {
  .hero__inner {
    flex-direction: column !important;
    gap: 2rem !important;
    padding: 3rem 1.5rem !important;
  }

  .hero__text {
    text-align: center;
    max-width: 100% !important;
  }

  .hero__title {
    font-size: 2.5rem !important;
    line-height: 1.1 !important;
  }

  .hero__subtitle {
    font-size: 14px !important;
    margin: 1.5rem 0 !important;
  }

  .hero__ctas {
    flex-direction: column !important;
    gap: 1rem !important;
    width: 100%;
  }

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

  .hero__visual {
    width: 100% !important;
    max-width: 400px;
    margin: 0 auto;
  }
}

/* ——— CART SIDEBAR MOBILE ——— */
@media (max-width: 768px) {
  .cart-sidebar {
    width: 100% !important;
    max-width: 100% !important;
  }

  .cart-sidebar__header {
    padding: 1.5rem !important;
  }

  .cart-sidebar__close {
    width: 44px !important;
    height: 44px !important;
  }

  .cart-item {
    padding: 1.5rem !important;
  }

  .cart-item__img {
    width: 80px !important;
    height: 80px !important;
  }

  .cart-sidebar__footer {
    padding: 1.5rem !important;
  }
}

/* ——— PAGE HERO MOBILE ——— */
@media (max-width: 768px) {
  .page-hero {
    padding: 3rem 1.5rem !important;
  }

  .page-hero__title {
    font-size: 2rem !important;
  }

  .page-hero__subtitle {
    font-size: 12px !important;
  }
}

/* ——— TOUCH IMPROVEMENTS ——— */
@media (max-width: 768px) {
  /* Augmenter les zones tactiles */
  a, button, [onclick] {
    -webkit-tap-highlight-color: rgba(0,0,0,0.05);
    tap-highlight-color: rgba(0,0,0,0.05);
  }

  /* Scroll smooth */
  html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }

  /* Input touch-friendly */
  input, select, textarea {
    font-size: 16px !important; /* Évite le zoom sur iOS */
    min-height: 48px;
  }

  /* Espacement sections */
  section {
    padding: 3rem 0 !important;
  }

  /* Typography mobile */
  h1 { font-size: 2rem !important; }
  h2 { font-size: 1.75rem !important; }
  h3 { font-size: 1.25rem !important; }
  h4 { font-size: 1.1rem !important; }

  p {
    font-size: 15px !important;
    line-height: 1.7 !important;
  }
}

/* ——— SMALL MOBILE (iPhone SE, etc.) ——— */
@media (max-width: 375px) {
  .hero__title {
    font-size: 2rem !important;
  }

  .product-detail-card__media {
    min-height: 350px !important;
  }

  .btn, .size-btn {
    font-size: 13px !important;
  }
}
