/* Kemati Shop 1.0 — palette beige, bois et doré */
.kemati-shop-intro {
  margin: 0 0 26px;
  padding: clamp(24px, 4vw, 46px);
  text-align: center;
  color: #30251b;
  background: linear-gradient(135deg, #f3eadc, #e7d6bf);
  border-radius: 14px;
}
.kemati-shop-intro h1 { margin: 0 0 10px; color: #30251b; font-size: clamp(25px, 3vw, 38px); }
.kemati-shop-intro > p { max-width: 720px; margin: 0 auto 16px; color: #65594b; }
.kemati-shop-values { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 22px; font-size: 12px; color: #76572f; }
.kemati-shop-values span::before { content: "✦"; margin-right: 7px; color: #bd8744; }

.kemati-category-carousel { margin: 0 0 26px; }
.kemati-category-viewport { overflow: hidden; width: 100%; }
.kemati-category-track { display: flex; gap: 16px; will-change: transform; transition: transform .55s ease; }
.kemati-category-tile { display: flex; flex: 0 0 calc((100% - 48px) / 4); min-width: 0; flex-direction: column; overflow: hidden; color: #30251b; background: #f7f1e8; border: 1px solid #e9ddcd; border-radius: 11px; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease; }
.kemati-category-tile:hover { color: #30251b; transform: translateY(-3px); box-shadow: 0 8px 22px rgba(48,37,27,.09); }
.kemati-category-tile img { display: block; width: 100%; aspect-ratio: 5 / 3; object-fit: cover; }
.kemati-category-tile > span:last-child { padding: 12px; text-align: center; font-weight: 600; font-size: 14px; }
.kemati-category-placeholder { display: grid; place-items: center; aspect-ratio: 5 / 3; color: #a77b42; background: #eadbc7; font-size: 36px; }
.kemati-category-dots { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 24px; margin-top: 10px; }
.kemati-category-dot { display: block; width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; background: #cdbda9; cursor: pointer; transition: width .2s ease, background .2s ease; }
.kemati-category-dot[aria-current="true"] { width: 21px; border-radius: 99px; background: #a87536; }

.kemati-shop-filters { position: relative; z-index: 80; margin: 0 0 22px; color: #30251b; }
.kemati-filter-bar { position: relative; z-index: 81; display: flex; align-items: center; flex-wrap: wrap; gap: 9px; padding: 12px; background: #f3eadc; border: 1px solid #e7d8c5; border-radius: 12px; }
.kemati-filter-heading { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 13px; }
.kemati-filter-heading span { display: grid; place-items: center; width: 29px; height: 29px; color: #fff; background: #30251b; border-radius: 7px; font-size: 18px; }
.kemati-filter-dropdown { position: relative; z-index: 82; }
.kemati-filter-dropdown[open] { z-index: 1000; }
.kemati-filter-dropdown[open] .kemati-filter-panel { z-index: 1001; }
.kemati-filter-dropdown > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; padding: 8px 12px; list-style: none; cursor: pointer; background: #fff; border: 1px solid #e1d3c1; border-radius: 99px; font-size: 12px; }
.kemati-filter-dropdown > summary::-webkit-details-marker { display: none; }
.kemati-filter-dropdown[open] > summary { border-color: #c38c48; }
.kemati-filter-dropdown > summary span { color: #9b6e35; }
.kemati-filter-panel { position: absolute; top: calc(100% + 7px); left: 0; z-index: 30; display: grid; gap: 9px; min-width: 220px; max-height: 290px; overflow: auto; padding: 14px; background: #fff; border: 1px solid #e5d8c8; border-radius: 11px; box-shadow: 0 12px 28px rgba(40,30,20,.14); }
.kemati-filter-panel label { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 13px; cursor: pointer; }
.kemati-filter-panel input[type=checkbox] { width: 16px; height: 16px; margin: 0; accent-color: #b9823d; }
.kemati-price-panel { box-sizing: border-box; width: 245px; min-width: 0; }
.kemati-price-panel label { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 110px); align-items: center; gap: 10px; width: 100%; min-width: 0; }
.kemati-price-panel input { box-sizing: border-box; display: block; width: 100%; min-width: 0; max-width: 100%; min-height: 36px; padding: 6px 8px; border: 1px solid #d8cbb9; border-radius: 5px; background: #fff; }
.kemati-apply-price { padding: 8px 12px; color: #fff; background: #30251b; border: 0; border-radius: 6px; cursor: pointer; }
.kemati-filter-sort { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 12px; }
.kemati-filter-sort select { max-width: 175px; min-height: 36px; padding: 6px 9px; background: #fff; border: 1px solid #e1d3c1; border-radius: 99px; font-size: 12px; }
.kemati-clear-filters { padding: 7px 3px; color: #805526; background: transparent; border: 0; font-size: 12px; text-decoration: underline; cursor: pointer; }
.kemati-active-filters { display: flex; flex-wrap: wrap; gap: 7px; margin: 9px 3px 0; }
.kemati-active-filters:empty { display: none; }
.kemati-active-filters span { padding: 5px 9px; color: #5c4933; background: #f3eadc; border-radius: 99px; font-size: 11px; }
.kemati-active-filters button { padding: 0 0 0 5px; color: inherit; background: none; border: 0; cursor: pointer; }

.kemati-shop-promo { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 35px 0 15px; padding: 25px 30px; color: #30251b; background: linear-gradient(120deg, #f1e5d4, #e4d0b5); border-radius: 13px; }
.kemati-shop-promo h2 { margin: 0 0 6px; color: #30251b; font-size: 23px; }
.kemati-shop-promo p { margin: 0; color: #65594b; }
.kemati-shop-promo > a { flex: 0 0 auto; padding: 11px 17px; color: #fff; background: #30251b; border-radius: 7px; text-decoration: none; font-size: 13px; font-weight: 600; }
.kemati-shop-promo > a:hover { color: #fff; background: #57432e; }

.kemati-shop-loading { opacity: .45; pointer-events: none; }
.woocommerce ul.products.columns-4 { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-left: 0; margin-right: 0; }
.woocommerce ul.products.columns-4::before, .woocommerce ul.products.columns-4::after { display: none; }
.woocommerce ul.products.columns-4 li.product { float: none; width: auto; margin: 0; min-width: 0; }
.kemati-shop-pagination { margin: 30px 0; text-align: center; }
.kemati-shop-pagination ul.page-numbers { display: inline-flex; gap: 7px; margin: 0; padding: 0; list-style: none; }
.kemati-shop-pagination a, .kemati-shop-pagination span { display: inline-grid; place-items: center; min-width: 34px; min-height: 34px; padding: 5px 9px; color: #805526; background: #f3eadc; border: 1px solid #e7d8c5; border-radius: 6px; text-decoration: none; }
.kemati-shop-pagination .current { color: #fff; background: #30251b; border-color: #30251b; }

@media (max-width: 1024px) {
  .kemati-category-tile { flex-basis: calc((100% - 16px) / 2); }
  .woocommerce ul.products.columns-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .kemati-filter-bar { gap: 8px; }
  .kemati-filter-heading { flex: 1 0 100%; }
  .kemati-filter-dropdown { flex: 1 1 calc(50% - 8px); min-width: 0; }
  .kemati-filter-dropdown > summary { width: 100%; }
  .kemati-filter-panel { box-sizing: border-box; width: min(280px, calc(100vw - 32px)); min-width: 0; max-width: calc(100vw - 32px); max-height: min(55vh, 320px); }
  /* Les panneaux alternent leur ancrage pour rester dans la largeur de l'écran. */
  .kemati-filter-dropdown:nth-of-type(odd) .kemati-filter-panel { left: 0; right: auto; }
  .kemati-filter-dropdown:nth-of-type(even) .kemati-filter-panel { left: auto; right: 0; }
  .kemati-price-panel { width: min(280px, calc(100vw - 32px)); }
  .kemati-price-panel label { grid-template-columns: minmax(0, 1fr) minmax(0, 110px); }
  .kemati-price-panel input { width: 100%; min-width: 0; }
  .kemati-filter-sort { flex: 1 0 100%; justify-content: space-between; margin: 4px 0 0; padding-top: 9px; border-top: 1px solid #dfcfba; }
  .kemati-filter-sort select { max-width: 65%; }
  .woocommerce ul.products.columns-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kemati-shop-promo { align-items: flex-start; flex-direction: column; padding: 20px; }
}


/* Kemati Shop 1.0.3 — corrections robustes des menus de filtres */
.kemati-shop-filters,
.kemati-shop-filters * {
  box-sizing: border-box;
}
.kemati-filter-bar {
  isolation: isolate;
}
.kemati-filter-dropdown {
  flex: 0 0 auto;
}
.kemati-filter-dropdown[open] {
  z-index: 1000;
}
.kemati-filter-dropdown[open] .kemati-filter-panel {
  z-index: 1001;
}
.kemati-filter-panel {
  width: max-content;
  min-width: 220px;
  max-width: min(320px, calc(100vw - 32px));
}
.kemati-price-panel {
  width: 245px;
  min-width: 0;
  max-width: min(280px, calc(100vw - 32px));
}
.kemati-price-panel label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 110px);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-width: 0;
}
.kemati-price-panel input {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

/* Sur mobile, les filtres forment une vraie grille avec un espacement fixe.
   Le menu ouvert prend toute la largeur et pousse le contenu vers le bas. */
@media (max-width: 767px) {
  .kemati-filter-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 9px;
  }
  .kemati-filter-heading {
    grid-column: 1 / -1;
    min-width: 0;
  }
  .kemati-filter-dropdown {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
  .kemati-filter-dropdown > summary {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 10px 12px;
    white-space: nowrap;
  }
  .kemati-filter-dropdown[open] {
    grid-column: 1 / -1;
    width: 100%;
  }
  .kemati-filter-dropdown .kemati-filter-panel,
  .kemati-filter-dropdown[open] .kemati-filter-panel {
    position: static;
    display: grid;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    max-height: 220px;
    margin-top: 7px;
    overflow-y: auto;
    box-shadow: 0 5px 14px rgba(40,30,20,.08);
  }
  .kemati-filter-dropdown .kemati-price-panel {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
  .kemati-price-panel label {
    grid-template-columns: minmax(0, 1fr) minmax(0, 120px);
  }
  .kemati-filter-sort {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    margin: 3px 0 0;
    padding-top: 10px;
    border-top: 1px solid #dfcfba;
  }
  .kemati-clear-filters {
    grid-column: 1 / -1;
    justify-self: start;
    padding: 3px 0 0;
  }
}
@media (max-width: 360px) {
  .kemati-filter-bar {
    grid-template-columns: minmax(0, 1fr);
  }
  .kemati-filter-dropdown,
  .kemati-filter-dropdown[open],
  .kemati-filter-sort,
  .kemati-clear-filters {
    grid-column: 1;
  }
}


/* Kemati Shop 1.0.5 — harmonisation des visuels produits sur mobile */
@media (max-width: 767px) {
  .woocommerce ul.products li.product a img,
  .woocommerce-page ul.products li.product a img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center;
  }
}


/* Kemati Shop 1.1.1 — alignement des vignettes et bouton d'achat visible */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.woocommerce ul.products li.product > a.woocommerce-LoopProduct-link,
.woocommerce-page ul.products li.product > a.woocommerce-LoopProduct-link,
.woocommerce ul.products li.product > a.woocommerce-loop-product__link,
.woocommerce-page ul.products li.product > a.woocommerce-loop-product__link {
  display: block;
  width: 100%;
  max-width: 100%;
}
.woocommerce ul.products li.product a img,
.woocommerce-page ul.products li.product a img {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
}

/* Bouton Ajouter au panier : contraste fort et présence constante. */
.woocommerce ul.products li.product a.button,
.woocommerce-page ul.products li.product a.button,
.woocommerce ul.products li.product .add_to_cart_button,
.woocommerce-page ul.products li.product .add_to_cart_button,
.woocommerce ul.products li.product .product_type_simple,
.woocommerce-page ul.products li.product .product_type_simple {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  margin: 12px 0 0;
  padding: 10px 14px;
  color: #fff !important;
  background: #211d19 !important;
  border: 1px solid #211d19 !important;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  opacity: 1 !important;
  visibility: visible !important;
  box-shadow: none;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.woocommerce ul.products li.product a.button:hover,
.woocommerce-page ul.products li.product a.button:hover,
.woocommerce ul.products li.product .add_to_cart_button:hover,
.woocommerce-page ul.products li.product .add_to_cart_button:hover {
  color: #fff !important;
  background: #8b5c2b !important;
  border-color: #8b5c2b !important;
}
