/**
 * DESTOCK SHOP30 — Responsive mobile global
 */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: clip;
  max-width: 100%;
}

@supports not (overflow: clip) {
  body {
    overflow-x: hidden;
  }
}

img,
video,
svg,
iframe {
  max-width: 100%;
  height: auto;
}

body.ds30-scroll-locked {
  position: fixed;
  width: 100%;
  overflow: hidden;
  touch-action: none;
}

body.ds30-mobile-nav-open .ds30-header {
  z-index: 1001;
}

body.ds30-mobile-nav-open .ds30-header.is-hidden {
  transform: none !important;
  pointer-events: auto !important;
}

@media (max-width: 767px) {
  /* ─── Menu mobile plein écran ─── */
  .ds30-mobile-menu-backdrop {
    position: fixed;
    top: var(--ds30-mobile-nav-top, 64px);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 997;
    border: 0;
    padding: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.55);
    cursor: pointer;
  }

  .ds30-mobile-menu-backdrop[hidden] {
    display: none !important;
  }

  .ds30-mobile-menu:not([hidden]) {
    display: block !important;
    position: fixed;
    top: var(--ds30-mobile-nav-top, 64px);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 998;
    background: #0d0d0d;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 0 0 calc(1rem + env(safe-area-inset-bottom, 0px));
    border: 0;
  }

  .ds30-mobile-menu .ds30-nav-list--v2 {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0;
    overflow: visible;
  }

  .ds30-mobile-menu .ds30-nav-item {
    flex: none;
    width: 100%;
    min-width: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .ds30-mobile-menu button.ds30-nav-link,
  .ds30-mobile-menu .ds30-nav-link,
  .ds30-mobile-menu .ds30-nav-list a {
    flex-direction: row !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 0.75rem !important;
    width: 100% !important;
    max-width: none !important;
    padding: 0.95rem 1rem !important;
    font-size: 0.8125rem !important;
    text-align: left !important;
    white-space: normal !important;
    border-radius: 0 !important;
  }

  .ds30-mobile-menu .ds30-nav-label {
    max-width: none !important;
  }

  .ds30-nav-mega--mobile {
    background: #111 !important;
    box-shadow: none !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.35rem 0 0.75rem !important;
  }

  /* Catégories mobile — accordéon natif (sans JS) */
  .ds30-nav-mobile-categories {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .ds30-nav-mobile-categories > summary {
    list-style: none;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    padding-right: 2rem !important;
  }

  .ds30-nav-mobile-categories > summary::after {
    content: '+';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1;
    opacity: 0.75;
  }

  .ds30-nav-mobile-categories[open] > summary::after {
    content: '−';
  }

  .ds30-nav-mobile-categories > summary::-webkit-details-marker {
    display: none;
  }

  .ds30-nav-mobile-categories[open] > summary {
    background: rgba(255, 255, 255, 0.06) !important;
  }

  .ds30-nav-mega-mobile-inner {
    background: #111;
    padding: 0.35rem 0 0.65rem;
  }

  .ds30-nav-item .ds30-nav-mobile-categories .ds30-nav-mega-mobile-group {
    margin: 0 0.75rem 0.5rem;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
  }

  .ds30-mobile-menu .ds30-nav-mega-mobile-group summary {
    color: #fff !important;
    -webkit-text-fill-color: #fff;
    font-size: 0.75rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.75rem 2rem 0.75rem 0.85rem !important;
    position: relative;
    touch-action: manipulation;
  }

  .ds30-mobile-menu .ds30-nav-mega-mobile-group summary::after {
    content: '+';
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    opacity: 0.85;
  }

  .ds30-mobile-menu .ds30-nav-mega-mobile-group[open] summary::after {
    content: '−';
  }

  .ds30-mobile-menu .ds30-nav-mega-mobile-group[open] summary {
    background: rgba(255, 255, 255, 0.08);
  }

  .ds30-mobile-menu .ds30-nav-mega-mobile-list a,
  .ds30-mobile-menu .ds30-nav-mega-mobile-list a span {
    color: #fff !important;
    -webkit-text-fill-color: #fff;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
  }

  .ds30-mobile-menu .ds30-nav-mega-mobile-list a {
    padding: 0.55rem 0.35rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .ds30-mobile-menu .ds30-nav-mega-mobile-list li:last-child a {
    border-bottom: 0;
  }

  .ds30-nav-mega--mobile.is-open,
  .ds30-nav-mega--mobile:not([hidden]) {
    display: block !important;
  }

  /* Mega menu desktop caché sur mobile */
  #ds30-nav-categories-mega {
    display: none !important;
  }

  body.ds30-nav-mega-open {
    overflow: visible;
  }

  /* ─── Header compact ─── */
  .ds30-header-inner--mockup {
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
  }

  .ds30-logo-white,
  .ds30-logo-blue {
    font-size: 1.125rem !important;
  }

  .ds30-logo-tagline {
    display: none;
  }

  .ds30-header-actions {
    gap: 0.35rem;
    margin-left: auto;
  }

  .ds30-header-action--account .ds30-action-label,
  .ds30-header-action--cart .ds30-action-label {
    display: none;
  }

  .ds30-header-action--account {
    padding: 0.35rem !important;
  }

  .ds30-header-action--cart {
    padding: 0.35rem !important;
  }

  .ds30-mobile-toggle {
    flex-shrink: 0;
  }

  .ds30-mobile-toggle.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .ds30-mobile-toggle.is-open span:nth-child(2) {
    opacity: 0;
  }

  .ds30-mobile-toggle.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .ds30-mobile-toggle span {
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  /* ─── Recherche header ─── */
  .ds30-header-search--mockup {
    order: 3;
    width: 100%;
    flex-wrap: wrap;
    gap: 0.45rem;
  }

  .ds30-header-search__quick {
    display: flex !important;
    flex: 1 1 100%;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.35rem;
    padding-bottom: 0.1rem;
  }

  .ds30-header-search__quick::-webkit-scrollbar {
    display: none;
  }

  .ds30-header-search__quick-btn {
    flex: 0 0 auto;
    min-width: 68px;
    max-width: none;
    padding: 0.4rem 0.45rem;
  }

  .ds30-header-search__quick-text strong {
    font-size: 0.5625rem;
  }

  .ds30-header-search__quick-text small {
    font-size: 0.5rem;
  }

  /* ─── Accueil ─── */
  .ds30-hero {
    position: relative;
    overflow: visible;
  }

  .ds30-hero-content {
    padding-right: 0.5rem;
  }

  .ds30c-hero-badge {
    top: 0.65rem !important;
    bottom: auto !important;
    right: 0.65rem !important;
    z-index: 30 !important;
    width: 84px !important;
    height: 84px !important;
  }

  .ds30c-hero-badge__inner {
    width: 72px !important;
    height: 72px !important;
  }

  .ds30c-hero-badge__label {
    font-size: 0.5rem !important;
  }

  .ds30c-hero-badge__sub {
    font-size: 0.4375rem !important;
  }

  .ds30-vehicle-search {
    margin-top: -16px !important;
    z-index: 15;
  }

  .ds30-hero-visuals {
    display: none !important;
  }

  .ds30-hero-inner {
    min-height: auto !important;
    padding: 1.75rem 1rem 1.25rem !important;
  }

  .ds30-hero-title {
    font-size: clamp(1.35rem, 7vw, 2rem) !important;
  }

  .ds30-categories-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.65rem !important;
  }

  .ds30-category-card {
    padding: 14px 8px !important;
  }

  .ds30-category-icon,
  .ds30-category-icon img {
    width: 64px !important;
    height: 64px !important;
  }

  .ds30-benefits-grid {
    grid-template-columns: 1fr !important;
    gap: 0.65rem !important;
  }

  .ds30-benefit-item {
    padding: 0.85rem !important;
  }

  .ds30-promo-content {
    max-width: 100% !important;
    padding-right: 0 !important;
  }

  .ds30-promo-image {
    position: relative !important;
    width: 100% !important;
    max-width: 140px !important;
    margin: 0.75rem auto 0 !important;
    right: auto !important;
    bottom: auto !important;
  }

  .ds30-carousel-prev {
    left: 0.25rem !important;
  }

  .ds30-carousel-next {
    right: 0.25rem !important;
  }

  .ds30-insta-nav-prev {
    left: 0 !important;
  }

  .ds30-insta-nav-next {
    right: 0 !important;
  }

  /* ─── WooCommerce / tableaux ─── */
  .woocommerce table.shop_table,
  .ds30-pro-orders-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .woocommerce table.shop_table thead,
  .woocommerce table.shop_table tbody,
  .woocommerce table.shop_table tr {
    width: 100%;
  }

  .ds30-pro-orders-table {
    min-width: 520px;
  }

  .ds30-pro-account-panel {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* ─── Conteneurs & grilles hubs ─── */
  .ds30-container {
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
  }

  .ds30-tire-diameter-grid,
  .ds30-parts-grid,
  .ds30-moto-hub-grid,
  .ds30-enfant-hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.65rem !important;
  }

  .ds30-dim-selects {
    min-width: 0 !important;
    width: 100%;
  }

  .ds30-plate-form,
  .ds30-search-panel {
    max-width: 100%;
  }

  /* ─── Pages Atelier (évite scroll horizontal) ─── */
  .ds30-atelier-shop-page,
  .ds30-atelier-landing-page,
  .ds30-atelier-product-page {
    overflow-x: clip;
  }

  @supports not (overflow: clip) {
    .ds30-atelier-shop-page,
    .ds30-atelier-landing-page,
    .ds30-atelier-product-page {
      overflow-x: hidden;
    }
  }

  /* ─── Footer & contenu général ─── */
  .ds30-footer-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  .ds30-checkout-layout {
    grid-template-columns: 1fr !important;
  }

  .ds30-single-product-layout {
    grid-template-columns: 1fr !important;
  }

  .ds30-account-layout {
    grid-template-columns: 1fr !important;
  }

  .ds30-account-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding-bottom: 0.25rem;
  }
}

@media (max-width: 399px) {
  .ds30-categories-grid {
    grid-template-columns: 1fr !important;
  }

  .ds30-tire-diameter-grid,
  .ds30-parts-grid,
  .ds30-moto-hub-grid,
  .ds30-enfant-hub-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (min-width: 768px) {
  .ds30-mobile-menu-backdrop {
    display: none !important;
  }
}
