/* =====================================================
   CSS PERSONNALISÉ SPAWORLD
   WooCommerce + Astra + Shortcodes
   ===================================================== */

/* =====================================================
   CARTES CATÉGORIES / MARQUES + PRODUITS
   WooCommerce + Astra
   ===================================================== */

:root {
  --card-radius: 8px;
  --card-border: #ededed;
  --card-border-hover: #d6d6d6;
  --card-bg: #ffffff;
  --card-shadow-hover: 0 4px 14px rgba(0,0,0,0.06);

  --card-pad-y: 22px;
  --card-pad-x: 18px;

  --gap: 24px;

  --img-h: 170px;

  --title-size: 13.5px;
  --title-weight: 600;
  --title-letter: 0.4px;
  --title-line: 1.3;
}

/* =====================================================
   GRID / ESPACEMENTS (BOUTIQUE)
   ===================================================== */

.woocommerce ul.products {
  gap: var(--gap);
  align-items: stretch;
}

.woocommerce ul.products li.product,
.woocommerce ul.products li.product-category {
  margin: 0 !important;
}

/* =====================================================
   1) CARTES CATÉGORIES / MARQUES
   ===================================================== */

.woocommerce ul.products li.product-category {
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  border-radius: var(--card-radius);
  padding: var(--card-pad-y) var(--card-pad-x);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.woocommerce ul.products li.product-category:hover {
  border-color: var(--card-border-hover);
  box-shadow: var(--card-shadow-hover);
}

.woocommerce ul.products li.product-category a {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  text-decoration: none;
  overflow: visible !important;
}

/* Zone image fixe */
.woocommerce ul.products li.product-category .woocommerce-loop-category__image,
.woocommerce ul.products li.product-category .ast-woo-shop-category-image {
  width: 100%;
  height: var(--img-h);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible !important;
}

.woocommerce ul.products li.product-category img {
  max-width: 100%;
  max-height: 100%;
  width: auto !important;
  height: auto !important;
  object-fit: contain;
  display: block;
}

.woocommerce ul.products li.product-category .woocommerce-loop-category__title {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;

  width: 100% !important;
  margin: 14px 0 0 !important;
  padding: 0 !important;

  position: static !important;
  transform: none !important;
  background: none !important;

  font-size: var(--title-size);
  font-weight: var(--title-weight);
  letter-spacing: var(--title-letter);
  line-height: var(--title-line);
  text-align: center !important;
}

.woocommerce-loop-category__title .count {
  display: none !important;
}

.woocommerce ul.products li.product-category a > img {
  width: 100% !important;
  height: var(--img-h) !important;
  object-fit: contain !important;
  display: block;
}

.woocommerce ul.products li.product:not(.product-category) a.woocommerce-LoopProduct-link > img {
  width: 100% !important;
  height: var(--img-h) !important;
  object-fit: contain !important;
  display: block;
}

/* Neutralisation overlays Astra */
.woocommerce ul.products li.product-category .ast-woo-shop-category-content,
.woocommerce ul.products li.product-category .ast-woo-shop-category-content * {
  position: static !important;
  background: none !important;
  transform: none !important;
}

/* =====================================================
   2) CARTES PRODUITS
   ===================================================== */

.woocommerce ul.products li.product:not(.product-category) {
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  border-radius: var(--card-radius);
  padding: var(--card-pad-y) var(--card-pad-x);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;

  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 300px;
}

.woocommerce ul.products li.product:not(.product-category):hover {
  border-color: var(--card-border-hover);
  box-shadow: var(--card-shadow-hover);
}

.woocommerce ul.products li.product:not(.product-category) a.woocommerce-LoopProduct-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  flex: 1;
  text-decoration: none;
  overflow: visible !important;
}

.woocommerce ul.products li.product:not(.product-category) a.woocommerce-LoopProduct-link {
  position: relative;
}

.woocommerce ul.products li.product:not(.product-category) a.woocommerce-LoopProduct-link img {
  max-width: 100%;
  max-height: var(--img-h);
  width: auto !important;
  height: auto !important;
  object-fit: contain;
  display: block;
}

.woocommerce ul.products li.product:not(.product-category) .woocommerce-loop-product__title {
  width: 100%;
  margin: 14px 0 6px !important;
  padding: 0 !important;

  font-size: var(--title-size);
  font-weight: var(--title-weight);
  letter-spacing: 0.2px;
  line-height: 1.35;
  text-align: center;
}

/* Catégorie produit */
.woocommerce ul.products li.product:not(.product-category) .ast-woo-product-category {
  width: 100%;
  margin: 0 0 8px !important;
  text-align: center;
  opacity: 0.7;
  font-size: 13px;
}

/* Prix */
.woocommerce ul.products li.product:not(.product-category) .price {
  width: 100%;
  margin: 0 !important;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
}

.woocommerce ul.products li.product:not(.product-category) .price del {
  opacity: 0.55;
  font-weight: 500;
}

.woocommerce ul.products li.product:not(.product-category) .price ins {
  background: none;
  font-weight: 700;
  text-decoration: none;
}

/* Badge promo */
.woocommerce ul.products li.product:not(.product-category) .onsale {
  border-radius: 999px;
  padding: 6px 10px;
  line-height: 1;
}

/* Neutralisation overlays Astra */
.woocommerce ul.products li.product:not(.product-category) .ast-woo-shop-product-content,
.woocommerce ul.products li.product:not(.product-category) .ast-woo-shop-product-content * {
  position: static !important;
  background: none !important;
  transform: none !important;
}

/* Fix titres 2 lignes */
.woocommerce ul.products li.product:not(.product-category) .woocommerce-loop-product__title {
  line-height: 1.35;
  min-height: calc(1.35em * 2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* =====================================================
   SEARCH RESULTS — harmonisé avec la boutique
   ===================================================== */

.search .site-content .ast-row,
.search .site-content .ast-container {
  max-width: 1200px;
}

/* Carte */
.search article {
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: var(--card-radius);
  background: var(--card-bg);
  padding: var(--card-pad-y) var(--card-pad-x);

  display: flex;
  flex-direction: column;
  height: 100%;

  box-shadow: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.search article:hover {
  border-color: var(--card-border-hover);
  box-shadow: var(--card-shadow-hover);
}

/* Image Search */
.search article .post-thumb img,
.search article .ast-blog-featured-section img {
  width: 100%;
  height: var(--img-h);
  object-fit: contain;
  display: block;
  margin: 0 auto 10px;
}

/* Titre Search */
.search article .entry-title,
.search article .entry-title a {
  text-align: center;
  font-size: var(--title-size);
  font-weight: var(--title-weight);
  letter-spacing: 0.2px;
  line-height: 1.35;
  margin: 14px 0 6px;
  text-decoration: none;
}

/* 2 lignes max (Search) */
.search article .entry-title {
  min-height: calc(1.35em * 2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Prix Search */
.search .sw-search-price {
  margin-top: auto;
  text-align: center;
  padding-top: 10px;
  font-size: 14px;
  font-weight: 600;
}

/* Masquer le blog */
.search article .entry-meta,
.search article .post-meta,
.search article .ast-excerpt-container,
.search article .ast-read-more,
.search article .more-link {
  display: none !important;
}

/* Garder uniquement le prix si injecté dans entry-content */
.search article .entry-content > * {
  display: none !important;
}
.search article .entry-content .sw-search-price {
  display: block !important;
}

/* =====================================================
   SHORTCODE : tableau images produits fournisseur
   (ancien <style> inline -> déplacé ici)
   ===================================================== */

.table-images-produit-fournisseur {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table-images-produit-fournisseur th,
.table-images-produit-fournisseur td {
  border: 1px solid #ddd;
  padding: 10px;
  vertical-align: middle;
  text-align: left;
}

.table-images-produit-fournisseur th {
  background: #f7f7f7;
  font-weight: 600;
}

.table-images-produit-fournisseur .col-apercu {
  text-align: center;
}

/* Images fournisseur */
.table-images-produit-fournisseur img.img-fournisseur {
  width: 110px;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid #ccc;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.table-images-produit-fournisseur img.img-fournisseur:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* =====================================================
   Espacement entre le titre de catégorie et le texte
   ===================================================== */

.woocommerce .sw-cat-hero__title {
  margin-bottom: 18px;
}

/* =====================================================
   Remonter le texte dans le cadre blanc (Astra)
   ===================================================== */

/* Réduit l’espace interne en haut du contenu */
.ast-separate-container .ast-article-post,
.ast-separate-container .ast-article-single,
.ast-separate-container .ast-woocommerce-container {
  padding-top: 30px !important; /* ajuste : 20 / 15 / 10 */
}

/* Supprime la marge haute du titre */
.page .entry-title,
.archive .page-title {
  margin-top: 0 !important;
}

/* Ajustement responsive : remonter un peu sur tablette/mobile */
@media (max-width: 1024px) {
  .ast-separate-container .ast-article-post,
  .ast-separate-container .ast-article-single,
  .ast-separate-container .ast-woocommerce-container {
    padding-top: 22px !important;
  }
}

@media (max-width: 768px) {
  .ast-separate-container .ast-article-post,
  .ast-separate-container .ast-article-single,
  .ast-separate-container .ast-woocommerce-container {
    padding-top: 16px !important;
  }
}
