/* ============================================================
   theme.css — colle entre WordPress et le design Star Track
   ============================================================ */

/* ---- Barre d'admin connecté : décale les éléments fixes ---- */
body.admin-bar { --wp-admin-h: 32px; }
@media (max-width: 782px) { body.admin-bar { --wp-admin-h: 46px; } }
body.admin-bar .header { top: var(--wp-admin-h, 32px); }

/* ---- Alignements éditeur / blocs classiques ---- */
.alignleft  { float: left;  margin: .5rem var(--sp-3) var(--sp-3) 0; }
.alignright { float: right; margin: .5rem 0 var(--sp-3) var(--sp-3); }
.aligncenter{ margin-inline: auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text {
  font-size: var(--text-xs);
  color: var(--muted);
  padding-top: .4rem;
}
.sticky { position: relative; }

/* ---- Contenu typographique (pages/posts non-Elementor) ---- */
.entry-content > * + * { margin-block-start: 1.1em; }
.entry-content h2, .entry-content h3 { margin-block-start: 1.6em; }
.entry-content a { color: var(--red); text-decoration: underline; text-underline-offset: 2px; }
.entry-content ul { list-style: disc; padding-left: 1.4rem; }
.entry-content ol { list-style: decimal; padding-left: 1.4rem; }
.entry-content img { border-radius: 0 !important; }

/* ---- Élémentaire pour les templates du thème ---- */
.stb-page-title {
  font-size: var(--text-2xl);
  padding-block: var(--sp-5) var(--sp-4);
}
.stb-loop-nav {
  display: flex; gap: .6rem;
  padding-block: var(--sp-4);
}
.stb-loop-nav .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; height: 44px; padding-inline: .8rem;
  font-family: var(--font-display); font-weight: 600;
  background: var(--paper); border: 1px solid var(--line);
}
.stb-loop-nav .page-numbers.current {
  background: var(--red); border-color: var(--red); color: #fff;
}

/* ---- Champs natifs WP habillés charte (hors formulaires Woo/Elementor) ---- */
input[type="text"], input[type="email"], input[type="search"],
input[type="url"], input[type="tel"], input[type="password"],
textarea, select {
  width: 100%;
  padding: .85rem 1rem;
  background: var(--paper);
  border: 2px solid var(--line);
  font-size: var(--text-sm);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--ink);
}
::placeholder { color: var(--muted); }

/* ---- Logo image du thème ---- */
.logo--img { display: inline-flex; align-items: center; }
.logo--img img { width: auto; height: 48px; }
.footer .logo--img img { height: 56px; }
.mobile-menu__head img { width: auto; height: 40px; }
@media (max-width: 480px) {
  .logo--img img { height: 42px; }
  .footer .logo--img img { height: 48px; }
}

/* ---- Prix WooCommerce dans la recherche live ---- */
.search-hit .woocommerce-Price-amount { font-weight: 700; font-family: var(--font-display); font-size: var(--text-sm); }
.search-hit del { opacity: .55; font-size: .66rem; }
.search-hit ins { text-decoration: none; }

/* ---- M5 : WooCommerce boutique + fiche produit ---- */

/* Tri natif Woo dans la toolbar boutique. */
.sort-wrap form { display: inline-block; margin: 0; }
.sort-wrap select,
select.stb-ordering {
  border: 1px solid var(--line);
  background: #fff;
  padding: .6rem .9rem;
  font-size: var(--text-sm);
  font-family: inherit;
}

/* Stepper quantité PDP (input number au lieu de output). */
.qty--pdp input[type="number"] {
  width: 56px;
  min-width: 44px;
  text-align: center;
  border: none;
  background: transparent;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
  -moz-appearance: textfield;
}
.qty--pdp input[type="number"]::-webkit-outer-spin-button,
.qty--pdp input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Favori YITH sur la fiche produit, carré bordé comme la maquette. */
.pdp__fav-wrap { display: flex; }
.pdp__fav-wrap a {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center !important;
  gap: 0 !important;
  font-size: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  transition: all .15s ease;
}
.pdp__fav-wrap a > *:not(svg) { display: none; }
.pdp__fav-wrap a svg.yith-wcwl-add-to-wishlist-button-icon,
.pdp__fav-wrap a svg {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  flex: 0 0 auto;
  margin: 0 !important;
}
.pdp__fav-wrap a:hover { border-color: var(--red); color: var(--red); }

/* Bouton WhatsApp pleine largeur sous le CTA. */
.wa-order-btn { margin-top: .8rem; }

/* Pagination native Woo. */
.stb-pagination { margin-top: var(--sp-5); }
.stb-pagination ul.page-numbers {
  list-style: none;
  display: flex;
  gap: .4rem;
  justify-content: center;
  padding: 0;
  margin: 0;
}
.stb-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding-inline: .6rem;
  border: 1px solid var(--line);
  background: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
}
.stb-pagination .page-numbers.current { background: var(--ink); color: #fff; border-color: var(--ink); }
.stb-pagination a.page-numbers:hover { border-color: var(--red); color: var(--red); }

/* Galerie native : neutraliser les styles FlexSlider de Woo si chargés. */
.pdp__gallery .woocommerce-product-gallery,
.pdp__gallery figure.woocommerce-product-gallery__wrapper { margin: 0; max-width: none; float: none; position: static; }

/* Chips filtres actifs : liens de retrait. */
.tag a { font-weight: 700; opacity: .7; color: inherit; }
.tag a:hover { opacity: 1; color: var(--orange); }

/* Grille boutique pendant un filtrage AJAX. */
.grid-products { transition: opacity .18s ease; }
.grid-products.is-loading { opacity: .4; pointer-events: none; }

/* ---- Feedback actions : spinner pendant l AJAX (serveur local lent) ---- */
.add_to_cart_button.loading,
.single_add_to_cart_button.loading {
  color: transparent !important;
  pointer-events: none;
  position: relative;
}
.add_to_cart_button.loading svg,
.single_add_to_cart_button.loading svg { opacity: 0; }
.add_to_cart_button.loading::after,
.single_add_to_cart_button.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  animation: stb-spin .7s linear infinite;
}
@keyframes stb-spin { to { transform: rotate(360deg); } }

/* ---- Favori YITH v4 : puce icône 38px, texte masqué ---- */
.card__fav a.yith-wcwl-add-to-wishlist-button {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0 !important;
  font-size: 0;
  overflow: hidden;
  cursor: pointer;
}
.card__fav a.yith-wcwl-add-to-wishlist-button > *:not(svg) { display: none; }
.card__fav a.yith-wcwl-add-to-wishlist-button svg.yith-wcwl-add-to-wishlist-button-icon,
.card__fav a.yith-wcwl-add-to-wishlist-button svg {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  flex: 0 0 auto;
  margin: 0 !important;
}
.card__fav a.yith-wcwl-add-to-wishlist-button.exists svg,
.card__fav svg#yith-wcwl-icon-heart-fill { fill: var(--red); stroke: var(--red); }
a.yith-wcwl-add-to-wishlist-button--added svg {
  color: var(--red);
  fill: var(--red);
}

/* ---- Carte produit : ne pas afficher le lien « Voir le panier » injecte par Woo apres ajout AJAX ---- */
.card__actions .added_to_cart,
.grid-products .added_to_cart {
  display: none !important;
}

/* ---- Reseaux sociaux en pied de page (Options du theme) ---- */
.footer__social {
  display: flex;
  gap: .5rem;
  margin-top: var(--sp-4);
}
.footer__social a {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  color: #fff;
  transition: all .15s ease;
}
.footer__social a svg { width: 17px; height: 17px; }
.footer__social a:hover { background: var(--red); border-color: var(--red); transform: translateY(-2px); }
