/* ========================================================================
   SHOP MENU - Styles spécifiques au menu de navigation shop
   (Les styles des produits sont dans woocommerce-products-global.css)
   ======================================================================== */

/* --------- Page sans titre + menu collé --------- */
.woocommerce-products-header,
.woocommerce-products-header__title,
.page-title {
  display: none !important;
}

/* Supprimer tout espace au-dessus du menu */
.woocommerce-page .site-content,
.woocommerce-page #primary,
.woocommerce-page .content-area,
.woocommerce-page main,
.woocommerce-page .entry-content,
.woocommerce-page article,
.woocommerce-page .woocommerce {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* Header shop : même style que les autres pages (pas de border/gap supplémentaire) */
.ast-woo-shop-archive .main-header-bar,
.ast-woo-shop-archive .ast-primary-header-bar,
.post-type-archive-product .main-header-bar,
.post-type-archive-product .ast-primary-header-bar,
.tax-product_cat .main-header-bar,
.tax-product_cat .ast-primary-header-bar {
  border-bottom: none !important;
  box-shadow: none !important;
}

/* Supprimer l'écart entre header et contenu sur la page shop */
.ast-woo-shop-archive .site-content,
.post-type-archive-product .site-content,
.tax-product_cat .site-content {
  padding-top: 0 !important;
}

.ast-woo-shop-archive #primary,
.post-type-archive-product #primary,
.tax-product_cat #primary {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* Supprimer le breadcrumb / entry-header Astra sur le shop */
.ast-woo-shop-archive .ast-archive-description,
.ast-woo-shop-archive .ast-archive-entry-banner,
.post-type-archive-product .ast-archive-description,
.post-type-archive-product .ast-archive-entry-banner,
.tax-product_cat .ast-archive-description,
.tax-product_cat .ast-archive-entry-banner {
  display: none !important;
}

/* --------- Bloc menu principal --------- */
.lef-shop-nav {
  margin: 0 0 20px;
  margin-left: calc(-1 * (100vw - 100%) / 2) !important;
  margin-right: calc(-1 * (100vw - 100%) / 2) !important;
  width: 100vw !important;
  max-width: 100vw !important;
  background: #fff;
  border-radius: 0;
  padding: 16px 14px 18px;
  border: none;
  border-top: 1px solid rgba(58, 166, 185, 0.3);
  border-bottom: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);
  overflow: visible;
  transition: opacity 0.2s ease;
}

.lef-shop-nav.lef-loading {
  opacity: 0.7;
  pointer-events: none;
}

/* --------- Mobile: menu pleine largeur sans bordures latérales --------- */
@media (max-width: 1024px) {
  .lef-shop-nav {
    margin: 0 -15px 15px -15px;
    border-radius: 0;
    border-left: none;
    border-right: none;
    padding: 12px 0 14px;
    box-shadow:
      0 8px 25px rgba(0, 0, 0, 0.15),
      0 4px 10px rgba(0, 0, 0, 0.1);
  }
  
  .woocommerce-page .lef-shop-nav {
    margin-left: calc(-1 * (100vw - 100%) / 2);
    margin-right: calc(-1 * (100vw - 100%) / 2);
    width: 100vw;
    max-width: 100vw;
  }
}

/* --------- Carrousel parent --------- */
.lef-parent-menu-wrap {
  position: relative;
  overflow: visible;
}

.lef-parent-menu {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  padding: 8px 60px;
  scroll-padding-left: 60px;
  scroll-padding-right: 60px;
}

.lef-parent-menu::-webkit-scrollbar {
  display: none;
}

.lef-parent-menu {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

@media (max-width: 1024px) {
  .lef-parent-menu {
    padding: 8px 10px;
    scroll-padding-left: 10px;
    scroll-padding-right: 10px;
    gap: 10px;
  }
}

/* --------- Item parent (catégories principales) --------- */
.lef-parent-box {
  flex: 0 0 auto;
  width: clamp(130px, 13vw, 200px);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  text-decoration: none;
  color: inherit;
  scroll-snap-align: start;
  transition:
    background-color 0.15s ease,
    transform 0.12s ease,
    box-shadow 0.12s ease;
  border: 2px solid transparent;
}

.lef-parent-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f5f5f5;
}

.lef-parent-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center; /* Centre l'image horizontalement et verticalement */
  display: block;
}

.lef-parent-title {
  display: block;
  padding: 10px 12px 12px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  text-align: center;
}

.lef-parent-box:hover {
  background: #FF5959;
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.16);
}

.lef-parent-box:hover .lef-parent-title {
  color: #fff;
}

.lef-parent-box.is-active {
  background: #FF5959;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
  border-color: #FF6B6B;
  transform: translateY(-1px);
}

.lef-parent-box.is-active .lef-parent-title {
  color: #fff;
}

/* --------- Flèches Desktop --------- */
.lef-menu-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: #FF6B6B;
  color: #fff;
  font-size: 26px;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  box-shadow: 
    0 6px 16px rgba(255, 107, 107, 0.4),
    0 3px 8px rgba(0, 0, 0, 0.15);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease,
    background-color 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.lef-menu-arrow:hover {
  background: #e04545;
  transform: translateY(-50%) scale(1.08);
  box-shadow: 
    0 8px 20px rgba(255, 107, 107, 0.5),
    0 4px 10px rgba(0, 0, 0, 0.2);
}

.lef-menu-arrow:active {
  transform: translateY(-50%) scale(0.95);
}

.lef-menu-arrow.lef-left {
  left: 6px;
}

.lef-menu-arrow.lef-right {
  right: 6px;
}

.lef-menu-arrow[disabled] {
  opacity: 0.3 !important;
  cursor: default;
  pointer-events: none;
}

.lef-menu-arrow[disabled]:hover {
  transform: translateY(-50%);
  background: #FF6B6B;
}

.lef-parent-menu-wrap.is-scrollable .lef-menu-arrow {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

@media (max-width: 1024px) {
  .lef-menu-arrow {
    display: none !important;
  }
}

/* --------- Sous-menus (chips) --------- */
.lef-submenu {
  margin-top: 12px;
  padding: 0 14px;
}

.lef-subsubmenu {
  margin-top: 10px;
  padding: 0 14px;
}

@media (max-width: 1024px) {
  .lef-submenu,
  .lef-subsubmenu {
    padding: 0 10px;
  }
}

.lef-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 10px;
  background: #fff;
  scroll-behavior: smooth;
}

.lef-chips::-webkit-scrollbar {
  display: none;
}

.lef-chips {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.lef-chip {
  flex: 0 0 auto;
  padding: 12px 16px;
  text-decoration: none;
  color: inherit;
  white-space: nowrap;
  border-right: 1px solid rgba(0, 0, 0, 0.18);
  user-select: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Montserrat', sans-serif;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.lef-chip:last-child {
  border-right: 0;
}

.lef-chip:hover {
  background: #FF5959;
  color: #fff;
}

.lef-chip:hover .lef-chip-count {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.lef-chip.is-active {
  background: #FF6B6B;
  color: #fff;
  font-weight: 700;
}

.lef-chip.is-active .lef-chip-count {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.lef-chip-count {
  font-size: 12px;
  opacity: 0.9;
  background: rgba(0, 0, 0, 0.08);
  padding: 2px 8px;
  border-radius: 999px;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.lef-chip.is-disabled {
  opacity: 0.6;
  pointer-events: none;
}

/* --------- Loading state --------- */
#lefResults {
  transition: opacity 0.2s ease;
  min-height: 200px;
}

#lefResults.lef-loading {
  opacity: 0.5;
  pointer-events: none;
}

#lefResults.lef-loading::before {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #FF6B6B;
  border-radius: 50%;
  animation: lef-spin 0.8s linear infinite;
  z-index: 9999;
}

@keyframes lef-spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ========================================================================
   DESKTOP: Conteneur produits avec marges (max 1700px)
   ======================================================================== */
@media (min-width: 1025px) {
  .woocommerce .woocommerce-result-count,
  .woocommerce .woocommerce-ordering,
  .woocommerce-page .woocommerce-result-count,
  .woocommerce-page .woocommerce-ordering,
  .woocommerce-notices-wrapper,
  .woocommerce .woocommerce-notices-wrapper {
    max-width: 1700px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 40px;
    padding-right: 40px;
  }

  .woocommerce ul.products,
  .woocommerce-page ul.products {
    margin-left: auto;
    margin-right: auto;
    max-width: 1700px;
    padding-left: 40px;
    padding-right: 40px;
  }
}

/* ========================================================================
   Responsive menu
   ======================================================================== */
@media (max-width: 768px) {
  .lef-parent-box {
    width: clamp(100px, 26vw, 140px);
  }

  .lef-parent-title {
    font-size: 11px;
    padding: 8px 6px 10px;
  }

  .lef-chip {
    padding: 10px 12px;
    font-size: 13px;
  }

  .lef-chip-count {
    font-size: 11px;
    padding: 2px 6px;
  }
}

@media (max-width: 480px) {
  .lef-parent-box {
    width: clamp(90px, 28vw, 120px);
  }

  .lef-parent-menu {
    gap: 8px;
  }
  
  .lef-parent-title {
    font-size: 10px;
    padding: 6px 4px 8px;
  }
}