/* ============================================================
   stb-widgets.css — ajustements Woo/YITH pour les cartes Startrack
   ============================================================ */

/* Note visible dans l'éditeur Elementor */
.stb-editor-note {
  padding: 1.2rem;
  border: 1px dashed var(--red);
  background: var(--red-soft, rgba(208,30,50,.06));
  color: var(--ink);
  font: 600 13px/1.5 var(--font-body, sans-serif);
}

/* Carte utilisée seule (widget autonome) : largeur maquette */
.elementor-widget-stb-product-card .card { max-width: 340px; }

/* ---- Prix WooCommerce dans la carte ---- */
.card .price { display: inline-flex; align-items: baseline; gap: .45rem; flex-wrap: wrap; }
.card .price ins { text-decoration: none; }
.card .price del {
  opacity: .55;
  font-size: .82em;
  font-weight: 500;
}
.card .woocommerce-Price-amount,
.price-row .woocommerce-Price-amount {
  font-family: var(--font-display);
  font-weight: 700;
}
.card__btn--ghosted { background: var(--bg-sand); color: var(--ink); }

/* Lien autour de l'image produit */
.card__media-link { display: block; width: 100%; height: 100%; }
.card__media-link img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Favoris YITH habillés comme le bouton cœur de la maquette ---- */
.card__media .card__fav,
.card__media .yith-wcwl-add-to-wishlist {
  position: absolute;
  top: .6rem;
  right: .6rem;
  z-index: 3;
  margin: 0 !important;
}
.yith-wcwl-add-to-wishlist .yith-wcwl-add-button,
.yith-wcwl-add-to-wishlist .yith-wcwl-wishlistexistsbrowse,
.yith-wcwl-add-to-wishlist .yith-wcwl-wishlistaddedbrowse {
  display: block !important;
}
.yith-wcwl-add-to-wishlist a,
.yith-wcwl-add-to-wishlist button,
.yith-wcwl-add-to-wishlist .feedback {
  display: grid !important;
  place-items: center;
  width: 38px !important;
  height: 38px !important;
  min-width: 0 !important;
  padding: 0 !important;
  background: var(--paper) !important;
  border: 1px solid var(--line) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: var(--ink) !important;
  font-size: 0 !important; /* masque le libellé texte */
  line-height: 1 !important;
  transition: all var(--dur-fast, .18s) ease !important;
}
.yith-wcwl-add-to-wishlist a:hover,
.yith-wcwl-add-to-wishlist button:hover {
  background: var(--red) !important;
  border-color: var(--red) !important;
  color: #fff !important;
}
.yith-wcwl-add-to-wishlist a::before,
.yith-wcwl-add-to-wishlist button::before {
  content: "\2661"; /* cœur vide */
  font-size: 18px;
  line-height: 1;
}
.yith-wcwl-add-to-wishlist .feedback img,
.yith-wcwl-add-to-wishlist .ajax-loading { display: none !important; }
.yith-wcwl-add-to-wishlist ul,
.yith-wcwl-add-to-wishlist li { list-style: none !important; margin: 0 !important; padding: 0 !important; }

/* ============ MEGAMENU RENDU ELEMENTOR ============ */
/* Les items .mega__item doivent etre les enfants directs de .mega__grid
   (grille 5 rayons + CTA). On neutralise donc les boites Elementor. */
#mega .elementor,
#mega .elementor .e-con,
#mega .elementor-widget,
#mega .elementor-widget-container { display: contents; }

/* ============ RAYONS — BANDE HORIZONTALE (widget stb-rayons-strip) ============ */
.rayons-strip {
  --rsw: 170px;
  --rsgap: var(--sp-4, 1rem);
  display: flex;
  justify-content: space-between;
  gap: var(--rsgap);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  padding-bottom: .5rem;
  scrollbar-width: none; /* Firefox */
}
.rayons-strip::-webkit-scrollbar { display: none; }
.rayons-strip__item {
  flex: 0 0 var(--rsw);
  min-width: var(--rsw);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  color: inherit;
  text-decoration: none;
}
.rayons-strip__pic {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  background: var(--bg-sand, #f4f0e7);
  border: 1px solid var(--line, #e5e1d8);
  overflow: hidden;
}
.rayons-strip__pic img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-med, .3s) var(--ease-out, ease-out);
}
.rayons-strip__item:hover .rayons-strip__pic img { transform: scale(1.05); }
.rayons-strip__ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: .6rem;
  background: var(--ink, #1c1a17);
  color: #fff;
}
.rayons-strip__ph-num {
  font-family: var(--font-display, sans-serif);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: .06em;
}
.rayons-strip__ph svg { width: 34px; height: 34px; opacity: .45; }
.rayons-strip__go {
  position: absolute;
  right: .6rem;
  bottom: .6rem;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--ink, #1c1a17);
  transition: background var(--dur-fast, .18s), color var(--dur-fast, .18s);
}
.rayons-strip__go svg { width: 16px; height: 16px; }
.rayons-strip__item:hover .rayons-strip__go { background: var(--red, #d01e32); color: #fff; }

/* ============ HEADER MOBILE (< 1024px) — façon app ============ */
/* Barre : burger à gauche, logo centré. Dessous : recherche live pleine largeur.
   Compte/panier/favoris vivent dans le drawer du burger. Topbar masquée. */
.m-search { display: none; }
.m-search-results { display: none; }

@media (max-width: 1023px) {
  /* La barre noire d'annonce n'a pas sa place sur mobile */
  .topbar { display: none; }

  #site-header .header__inner {
    position: relative;
    height: auto;
    min-height: 52px;
    padding-block: 7px;
    justify-content: flex-start;
    gap: var(--sp-2);
  }

  /* Logo parfaitement centré, indépendant du flux */
  #site-header .header__inner .logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }
  #site-header .logo img,
  #site-header .logo--custom img { height: 34px; width: auto; display: block; }

  /* Seul le burger reste visible dans les actions */
  #site-header .nav { display: none; }
  #site-header .header__actions .icon-btn:not(.burger) { display: none; }

  /* Barre de recherche inline : vraie saisie */
  #site-header .m-search {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: 0 auto 10px;
    width: min(600px, calc(100% - 32px));
    min-height: 44px;
    padding-inline: 14px;
    background: #fff;
    border: 1px solid var(--line, #e5e1d8);
    color: var(--muted, #7c7568);
  }
  #site-header .m-search:focus-within { border-color: var(--ink, #1c1a17); }
  #site-header .m-search svg { width: 18px; height: 18px; flex-shrink: 0; }
  #site-header .m-search input {
    border: 0;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: .95rem;
    color: var(--ink-2, #33302a);
    width: 100%;
    -webkit-appearance: none;
  }
  #site-header .m-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
  #site-header .m-search input::placeholder { color: var(--muted, #7c7568); }

  /* Résultats live sous la recherche (dans le header fixe) */
  #site-header {
    position: fixed;
    top: var(--wp-admin--admin-bar--height, 0px);
    left: 0;
    right: 0;
    z-index: var(--z-header, 90);
  }
  /* Le contenu ne passe pas sous le header : pad posé en JS (--stb-mhh),
     animé pour accompagner le basculement compact/complet. */
  body {
    padding-top: var(--stb-mhh, 108px);
    transition: padding-top var(--dur-med, .3s) var(--ease-out, ease-out);
  }

  /* Compact au scroll descendant : la rangée logo/burger glisse ET libère
     sa place (marge négative --stb-rowh posée en JS), seule la recherche
     reste accrochée en haut. Remontée => tout revient. */
  #site-header .header__inner {
    transition: transform var(--dur-med, .3s) var(--ease-out, ease-out),
                margin-bottom var(--dur-med, .3s) var(--ease-out, ease-out);
    will-change: transform;
    margin-bottom: 0;
  }
  #site-header.is-compact .header__inner {
    transform: translateY(-110%);
    margin-bottom: calc(-1 * var(--stb-rowh, 54px));
  }
  #site-header.is-compact .m-search { margin-top: 0; }
  #site-header .m-search-results.is-open {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: calc(var(--z-header, 90) + 5);
    max-height: min(62vh, 480px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border-top: 1px solid var(--line, #e5e1d8);
    border-bottom: 1px solid var(--line, #e5e1d8);
    box-shadow: 0 18px 30px rgba(28, 26, 23, .14);
    padding: .4rem 16px 1rem;
  }
  #site-header .m-search-results .search-hit {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .55rem 0;
    border-bottom: 1px solid var(--line, #efece4);
    color: var(--ink-2, #33302a);
  }
  #site-header .m-search-results .search-hit:last-child { border-bottom: 0; }
  #site-header .m-search-results .search-hit img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-sand, #f4f0e7);
  }
  #site-header .m-search-results .search-hit b {
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  #site-header .m-search-results .search-empty {
    padding: 1rem 0 .4rem;
    font-size: .88rem;
    color: var(--muted, #7c7568);
    line-height: 1.6;
  }

  /* Le panneau mega desktop reste masqué sur mobile */
  #site-header .mega { display: none; }
}

/* ============ CARROUSELS PRODUITS — SWIPE TACTILE/SOURIS ============ */
.carousel__track { touch-action: pan-y; cursor: grab; }
.carousel__track.is-drag { transition: none !important; cursor: grabbing; user-select: none; -webkit-user-select: none; }
.carousel__track.is-drag * { pointer-events: none; }
