/* ════════════════════════════════════════════════════════════
   RESPONSIVE GLOBAL — Boturea
   Tous les écrans : 1200 → 960 → 768 → 640 → 480 → 375px
   ════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════
   BREAKPOINT 1200px — grands tablettes / petits laptops
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {

  /* Dashboard */
  .bac-page { max-width: 100% !important; padding: 0 24px 80px !important; }

  /* Single product */
  .bsp-layout { grid-template-columns: 1fr 1fr !important; gap: 32px !important; padding: 0 32px !important; }
  .bsp-lower, .bsp-breadcrumb { padding-left: 32px !important; padding-right: 32px !important; }

  /* Shop boutique */
  .bsp-section { grid-template-columns: 200px 1fr !important; }
  .bsp-section__info { padding: 0 24px 0 32px !important; }

  /* Footer */
  .bf-main { grid-template-columns: 1fr 1fr 1fr !important; }
  .bf-brand { grid-column: 1 / -1 !important; grid-template-columns: 1fr 1fr !important; }
}

/* ═══════════════════════════════════════════════════════════
   BREAKPOINT 960px — tablettes
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 960px) {

  /* ── NAV ── */
  body { padding-top: 56px !important; }

  .boturea-nav__inner { height: 56px !important; }
  .boturea-nav__links,
  .boturea-nav__search-pill { display: none !important; }
  .boturea-hamburger { display: flex !important; order: -1; }
  .boturea-search-mobile { display: flex !important; }
  .boturea-nav__logo {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin: 0 !important;
  }

  /* ── DASHBOARD Mon Compte ── */
  .bac-page {
    grid-template-columns: 1fr !important;
    padding: 12px 12px 60px !important;
    margin-top: 8px !important;
    gap: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }
  .bac-sidebar { position: static !important; width: 100% !important; }
  .bac-profile {
    padding: 14px !important;
    gap: 10px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    overflow: hidden !important;
  }
  .bac-profile__name { font-size: 0.875rem !important; }
  .bac-profile__email {
    max-width: 100% !important;
    font-size: 0.7rem !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .bac-nav {
    flex-direction: row !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    border-radius: 12px !important;
  }
  .bac-nav::before { display: none !important; }
  .bac-nav::-webkit-scrollbar { display: none; }
  .bac-nav-link {
    white-space: nowrap !important;
    border-left: none !important;
    border-bottom: 2px solid transparent !important;
    flex-shrink: 0 !important;
    padding: 10px 14px !important;
    font-size: 0.8rem !important;
  }
  .bac-nav-link--active {
    background: var(--g) !important;
    color: var(--white) !important;
    border-left: none !important;
    border-bottom: none !important;
    border-radius: 8px !important;
  }
  .bac-nav-link--logout { border-top: none !important; margin-top: 0 !important; }

  .bac-content {
    padding: 16px 14px !important;
    border-radius: 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  /* Stats dashboard — 3 colonnes compactes */
  .bac-stats-row { grid-template-columns: repeat(3, 1fr) !important; gap: 8px !important; }
  .bac-stat-card { padding: 12px 10px !important; gap: 4px !important; }
  .bac-stat-card svg { width: 16px !important; height: 16px !important; }
  .bac-stat-card__num { font-size: 1.1rem !important; }
  .bac-stat-card__label { font-size: 0.65rem !important; }

  /* Titre + section */
  .bac-page-title { font-size: 1.1rem !important; margin-bottom: 14px !important; }
  .bac-section-title { font-size: 0.62rem !important; margin: 14px 0 8px !important; }

  /* Tableau commandes — scroll horizontal */
  .bac-table-wrap, .bac-content table { display: block !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch !important; }
  .bac-table { min-width: 460px !important; }
  .bac-table th { padding: 9px 10px !important; font-size: 0.62rem !important; }
  .bac-table td { padding: 10px 10px !important; font-size: 0.78rem !important; }

  /* Raccourcis — colonne */
  .bac-shortcuts { flex-direction: column !important; gap: 6px !important; width: 100% !important; }
  .bac-shortcut {
    width: 100% !important;
    justify-content: flex-start !important;
    padding: 10px 12px !important;
    font-size: 0.78rem !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  .bac-shortcut svg { width: 14px !important; height: 14px !important; flex-shrink: 0 !important; }

  /* Vider l'espace inutile */
  .bac-empty { padding: 32px 0 !important; font-size: 0.85rem !important; }

  /* ── SINGLE PRODUCT ── */
  .bsp-layout {
    grid-template-columns: 1fr !important;
    padding: 0 16px !important;
    gap: 16px !important;
  }
  .bsp-gallery { position: static !important; }
  .bsp-lower, .bsp-breadcrumb { padding-left: 16px !important; padding-right: 16px !important; }
  .bsp-related__grid { grid-template-columns: repeat(2, 1fr) !important; }

  /* ── SHOP BOUTIQUE ── */
  .bsp-section { grid-template-columns: 1fr !important; padding: 28px 0 !important; }
  .bsp-section__info { padding: 0 20px 20px !important; border-bottom: 1px solid var(--border) !important; }
  .bsp-section__carousel-wrap { border-left: none !important; }
  .bsp-filters { top: 56px !important; }
  .bsp-filters__tabs { padding-left: 20px !important; }

  /* ── PANIER ── */
  .woocommerce-cart .woocommerce { padding: 0 16px 60px !important; }
  .cart-collaterals .cart_totals { max-width: 100% !important; }

  /* ── HERO HOME ── */
  .bt-hero { flex-direction: column !important; }
  .bt-left { padding: 48px 20px 32px !important; }
  .bt-right { width: 100% !important; padding: 28px 20px 40px !important; }
  .bt-divider { display: none !important; }
  .bt-text { max-width: 100% !important; text-align: center !important; }
  .bt-actions, .bt-stats, .bt-badges-row, .bt-payments { justify-content: center !important; }
  .bt-stat-item { align-items: center !important; text-align: center !important; }
  .bt-payments { align-items: center !important; }

  /* ── FOOTER ── */
  .bf-newsletter-inner { flex-direction: column !important; gap: 20px !important; text-align: center !important; }
  .bf-newsletter-form { width: 100% !important; max-width: 400px !important; flex-direction: column !important; }
  .bf-newsletter-form input[type="email"] { width: 100% !important; }
  .bf-newsletter-form button { width: 100% !important; }
  .bf-trust-inner { grid-template-columns: repeat(2, 1fr) !important; }
  .bf-main { grid-template-columns: 1fr 1fr !important; padding: 40px 24px !important; gap: 28px !important; }
  .bf-brand { grid-column: 1 / -1 !important; }
  .bf-bottom-inner { flex-direction: column !important; gap: 16px !important; }
  .bf-legal { flex-wrap: wrap !important; gap: 8px !important; }

  /* ── COLLECTIONS home ── */
  .btr-collections__grid { grid-template-columns: repeat(3, 1fr) !important; }
  .bdc-sections { padding: 0 16px !important; }
}

/* ═══════════════════════════════════════════════════════════
   BREAKPOINT 768px — mobile paysage
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Titres hero ── */
  .bt-title { font-size: clamp(32px, 8vw, 52px) !important; }
  .bsp-title, .bsp-info .product_title { font-size: 1.3rem !important; }

  /* ── Dashboard stats ── */
  .bac-stats-row { grid-template-columns: 1fr !important; }

  /* ── Tables → scroll ── */
  .woocommerce-cart-form { overflow-x: auto !important; }
  .woocommerce-cart-form table.shop_table { min-width: 500px !important; }
  .woocommerce-cart-form table thead { display: none !important; }
  .woocommerce-cart-form table td { display: block !important; padding: 8px 16px !important; border-bottom: none !important; }
  .woocommerce-cart-form table tr { border-bottom: 1px solid var(--border) !important; display: block !important; padding: 12px 0 !important; }

  /* ── Collections ── */
  .btr-collections__grid { grid-template-columns: repeat(2, 1fr) !important; }
  .btr-design-cols__grid { grid-template-columns: repeat(3, 1fr) !important; }

  /* ── Product grids ── */
  .bpl-wrap ul.products { grid-template-columns: repeat(2, 1fr) !important; }

  /* ── Best-sellers grid ── */
  .btr-bs-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .btr-bs-card:nth-child(2) { border-right: none !important; }
  .btr-bs-card:nth-child(3), .btr-bs-card:nth-child(4) { border-top: 1px solid var(--border) !important; }

  /* ── Section À propos ── */
  .btr-about { grid-template-columns: 1fr !important; }
  .btr-about__visual { height: 45vw !important; }
  .btr-about__content { padding: 40px 24px !important; }
  .btr-about__stats { flex-direction: row !important; min-width: 0 !important; width: 100% !important; border-radius: 14px !important; }
  .btr-about__stat { flex: 1 !important; padding: 16px 12px !important; text-align: center !important; }

  /* ── Footer ── */
  .bf-main { grid-template-columns: 1fr !important; padding: 32px 20px !important; }
  .bf-trust-inner { grid-template-columns: 1fr !important; }
  .bf-payments { flex-wrap: wrap !important; justify-content: center !important; }

  /* ── Login page ── */
  .blf-wrap { grid-template-columns: 1fr !important; }
  .blf-left { border-right: none !important; border-bottom: 1px solid var(--border) !important; padding: 36px 24px !important; }
  .blf-right { padding: 36px 24px !important; }

  /* ── Page design ── */
  .bdc-hero-full { height: 48vh !important; }
  .bdc-static-hero { height: 40vh !important; }

  /* ── Checkout ── */
  .bco-body .woocommerce-billing-fields__field-wrapper,
  .bco-body .woocommerce-shipping-fields__field-wrapper { grid-template-columns: 1fr !important; }
  .bco-manual-ship .bco-ship-row { grid-template-columns: 1fr !important; }
  .woocommerce-checkout .woocommerce { padding: 16px 14px 60px !important; }
}

/* ═══════════════════════════════════════════════════════════
   BREAKPOINT 640px — mobile portrait
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {

  /* ── Nav logo texte ── */
  .boturea-nav__logo-text { font-size: 1rem !important; }

  /* ── Dashboard ── */
  .bac-page { padding: 12px 12px 48px !important; }
  .bac-content { padding: 16px 14px !important; border-radius: 12px !important; }
  .bac-profile { padding: 14px 16px !important; gap: 12px !important; }
  .bac-avatar { width: 44px !important; height: 44px !important; font-size: 1.2rem !important; }
  .bac-shortcuts { flex-direction: column !important; }
  .bac-shortcut { width: 100% !important; justify-content: center !important; }

  /* ── Hero ── */
  .bt-left { padding: 36px 16px 28px !important; }
  .bt-right { padding: 20px 16px 36px !important; }
  .bt-stats { gap: 0 !important; }
  .bt-stat-item { padding: 0 12px 0 0 !important; }
  .bt-stat-sep { margin: 0 12px 0 0 !important; height: 32px !important; }

  /* ── Collections ── */
  .btr-collections__head, .btr-bs-head,
  .btr-design-cols__head { padding: 22px 16px 18px !important; flex-wrap: wrap !important; }
  .btr-collections__title, .btr-bs-title,
  .btr-design-cols__title { font-size: 1.6rem !important; }
  .btr-collections__grid { grid-template-columns: repeat(2, 1fr) !important; }
  .btr-design-cols__grid { grid-template-columns: repeat(2, 1fr) !important; }

  /* ── Produits similaires ── */
  .bsp-related__grid { grid-template-columns: repeat(2, 1fr) !important; border-radius: 12px !important; }
  .bsp-rel-card:nth-child(2n) { border-right: none !important; }

  /* ── Bestsellers → slider horizontal ── */
  .btr-bs-grid {
    display: flex !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    gap: 12px !important;
    padding: 0 16px 16px !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }
  .btr-bs-grid::-webkit-scrollbar { display: none !important; }
  .btr-bs-card {
    flex: 0 0 72vw !important;
    scroll-snap-align: start !important;
    border-right: none !important;
    border-bottom: none !important;
  }

  /* ── Footer ── */
  .bf-newsletter { padding: 32px 16px !important; }
  .bf-bottom { padding: 20px 16px !important; }
  .bf-legal a, .bf-legal span { font-size: 0.72rem !important; }

  /* ── Single product tabs ── */
  .bsp-lower .woocommerce-tabs ul.tabs li a { padding: 10px 12px !important; font-size: 0.78rem !important; }
  .bsp-lower .woocommerce-tabs .panel { padding: 20px 16px !important; }

  /* ── Product loop ── */
  .bpl-toolbar { padding: 12px 16px !important; }
  .bcat-grid-wrap { padding: 20px 14px 48px !important; }

  /* ── Checkout ── */
  .bco-header { padding: 14px 16px !important; }
  .bco-body { padding: 20px 16px !important; }
  .bco-btn { height: 46px !important; font-size: 0.9rem !important; }
  #payment .place-order { padding: 14px 16px !important; }
  #order_review table td, #order_review table th { padding: 10px 14px !important; font-size: 0.82rem !important; }
}

/* ═══════════════════════════════════════════════════════════
   BREAKPOINT 480px — petits mobiles
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {

  /* Nav icônes ── */
  .boturea-nav__logo-text { display: none !important; }
  .boturea-cart-count { width: 14px !important; height: 14px !important; font-size: 0.55rem !important; }

  /* ── Hero stats ── */
  .bt-payments__icons { gap: 4px !important; }
  .bt-pay { height: 20px !important; padding: 0 6px !important; font-size: 0.68rem !important; }

  /* ── Collections → slider horizontal ── */
  .btr-collections__grid {
    display: flex !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    gap: 12px !important;
    padding: 0 16px 16px !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }
  .btr-collections__grid::-webkit-scrollbar { display: none !important; }
  .btr-col-card {
    flex: 0 0 68vw !important;
    scroll-snap-align: start !important;
  }

  /* ── Product grid → 1 produit par écran ── */
  .bpl-wrap ul.products {
    display: flex !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    gap: 0 !important;
    padding: 0 !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }
  .bpl-wrap ul.products::-webkit-scrollbar { display: none !important; }
  .bpl-wrap ul.products .bpl-card,
  .bpl-wrap ul.products li.product {
    flex: 0 0 100vw !important;
    max-width: 100vw !important;
    scroll-snap-align: start !important;
    border-right: none !important;
  }

  /* ── Account nav texte masqué ── */
  .bac-nav-link span { font-size: 0.72rem !important; }

  /* ── Dashboard compact ── */
  .bac-stats-row { grid-template-columns: 1fr !important; gap: 6px !important; }
  .bac-stat-card { flex-direction: row !important; align-items: center !important; padding: 12px 14px !important; gap: 12px !important; }
  .bac-stat-card__num { font-size: 1.2rem !important; }
  .bac-page-title { font-size: 1rem !important; }
  .bac-content { padding: 14px 12px !important; }

  /* ── Footer ── */
  .bf-socials { justify-content: center !important; }
  .bf-trust-item { flex-direction: column !important; text-align: center !important; align-items: center !important; }

  /* ── Cart ── */
  .woocommerce-cart .woocommerce::before { font-size: 1.6rem !important; }
  .cart_totals table.shop_table th,
  .cart_totals table.shop_table td { padding: 12px 16px !important; }
  .cart_totals .wc-proceed-to-checkout { padding: 14px 16px !important; }

  /* ── Login ── */
  .blf-title { font-size: 1.4rem !important; }
  .blf-right__title { font-size: 1.6rem !important; }
}

/* ═══════════════════════════════════════════════════════════
   BREAKPOINT 375px — iPhone SE / très petits écrans
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 375px) {

  .bac-page { padding: 8px 8px 40px !important; }
  .bac-nav-link { padding: 8px 10px !important; font-size: 0.72rem !important; }
  .bac-content { padding: 14px 12px !important; }

  .bt-left { padding: 28px 12px 20px !important; }
  .bt-right { padding: 16px 12px 28px !important; }

  .blf-left, .blf-right { padding: 28px 16px !important; }

  .bco-header { padding: 12px 14px !important; }
  .bco-body { padding: 16px 12px !important; }

  .woocommerce-checkout .woocommerce { padding: 10px 10px 40px !important; }

  .bf-main { padding: 24px 14px !important; }
  .bf-newsletter { padding: 24px 14px !important; }
}

/* ═══════════════════════════════════════════════════════════
   IMAGES RESPONSIVE GLOBAL
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 960px) {
  img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Empêche les images de déborder de leur conteneur */
  .entry-content img,
  .woocommerce img,
  .site-content img {
    max-width: 100% !important;
    height: auto !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   ANTI-OVERFLOW GLOBAL — empêche le défilement horizontal
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 960px) {
  /* Empêcher tout débordement horizontal */
  .woocommerce-account body,
  .woocommerce-account .site-content,
  .woocommerce-account #primary,
  .woocommerce-account #main,
  .bac-page,
  .bac-sidebar,
  .bac-content,
  .bac-nav {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Nav du compte — ne pas déborder */
  .bac-nav { overflow-x: auto !important; overflow-y: hidden !important; }
  .bac-nav-link { white-space: nowrap !important; flex-shrink: 0 !important; }
}

/* ═══════════════════════════════════════════════════════════
   UTILITAIRES GLOBAUX MOBILES
   ═══════════════════════════════════════════════════════════ */

/* Scroll horizontal sur tous les tableaux WooCommerce */
@media (max-width: 768px) {
  .woocommerce table.shop_table,
  .woocommerce-account table,
  .bac-content table {
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-width: 100% !important;
  }

  /* Adresses en 1 colonne */
  .woocommerce-account .woocommerce-Addresses,
  .bac-content .woocommerce-Addresses {
    grid-template-columns: 1fr !important;
  }

  /* Textes ne débordent pas */
  .bac-page-title,
  .bac-section-title,
  .bac-stat-card__num {
    word-break: break-word !important;
  }
}
