:root{
  --tm12-ink:#1d1a16;
  --tm12-muted:#736b61;
  --tm12-border:#e8dfd2;
  --tm12-ivory:#fbf8f2;
  --tm12-gold:#a98245;
  --tm12-gold-dark:#7e612f;
  --tm12-white:#fff;
  --tm12-shadow:0 14px 36px rgba(36,28,19,.10);
}

/* Catalogue only */
.tm-boutique-pro-v12 #primary,
.tm-boutique-pro-v12 .site-main{max-width:100%;}

.tm-boutique-pro-v12 ul.products{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:22px!important;
  clear:both!important;
  margin:22px 0 0!important;
}
.tm-boutique-pro-v12 ul.products::before,
.tm-boutique-pro-v12 ul.products::after{display:none!important;content:none!important}

.tm-boutique-pro-v12 ul.products li.product{
  width:auto!important;
  float:none!important;
  margin:0!important;
  min-width:0;
  display:flex!important;
  flex-direction:column;
  position:relative;
  overflow:hidden;
  border:1px solid var(--tm12-border);
  border-radius:18px;
  background:var(--tm12-white);
  box-shadow:0 4px 18px rgba(36,28,19,.04);
  transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease;
}
.tm-boutique-pro-v12 ul.products li.product:hover{
  transform:translateY(-3px);
  border-color:#d9c8af;
  box-shadow:var(--tm12-shadow);
}

.tm-boutique-pro-v12 ul.products li.product a.woocommerce-LoopProduct-link{display:block;text-decoration:none!important}
.tm-boutique-pro-v12 ul.products li.product img{
  width:100%!important;
  aspect-ratio:1/1;
  object-fit:contain;
  margin:0!important;
  padding:8px;
  background:var(--tm12-ivory);
}

.tm-boutique-pro-v12 ul.products li.product .woocommerce-loop-product__title,
.tm-boutique-pro-v12 ul.products li.product h2{
  margin:0!important;
  padding:13px 14px 3px!important;
  min-height:48px;
  color:var(--tm12-ink)!important;
  font-size:15px!important;
  font-weight:800!important;
  line-height:1.35!important;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
}

.tm-boutique-pro-v12 ul.products li.product .price{
  display:block!important;
  margin:0!important;
  padding:4px 14px 10px!important;
  color:var(--tm12-ink)!important;
  font-size:16px!important;
  font-weight:900!important;
  line-height:1.25!important;
}
.tm-boutique-pro-v12 ul.products li.product .price del{opacity:.5;font-size:.82em}
.tm-boutique-pro-v12 ul.products li.product .price ins{text-decoration:none}
.tm-v12-from{font-weight:700;color:var(--tm12-muted);font-size:.82em}
.tm-v12-price-missing{color:var(--tm12-gold-dark);font-size:.88em;font-weight:800}

.tm-boutique-pro-v12 ul.products li.product .button,
.tm-boutique-pro-v12 ul.products li.product .tm-v12-card-cta{
  display:flex!important;
  align-items:center;
  justify-content:center;
  width:calc(100% - 24px)!important;
  min-height:44px;
  margin:auto 12px 12px!important;
  padding:10px 10px!important;
  border:1px solid var(--tm12-ink)!important;
  border-radius:12px!important;
  background:var(--tm12-ink)!important;
  color:#fff!important;
  text-align:center!important;
  text-decoration:none!important;
  font-size:13px!important;
  font-weight:900!important;
  line-height:1.2!important;
  transition:.18s ease;
}
.tm-boutique-pro-v12 ul.products li.product .button:hover,
.tm-boutique-pro-v12 ul.products li.product .tm-v12-card-cta:hover{
  background:var(--tm12-gold-dark)!important;
  border-color:var(--tm12-gold-dark)!important;
}

.tm-v12-badges{
  position:absolute;
  z-index:4;
  top:9px;
  left:9px;
  display:flex;
  gap:5px;
  pointer-events:none;
}
.tm-v12-badge{
  display:inline-flex;
  align-items:center;
  min-height:24px;
  padding:4px 8px;
  border-radius:999px;
  box-shadow:0 3px 10px rgba(0,0,0,.08);
  font-size:9px;
  font-weight:900;
  letter-spacing:.02em;
}
.tm-v12-badge-new{background:#fff;color:var(--tm12-ink)}
.tm-v12-badge-sale{background:var(--tm12-gold);color:#fff}

/* One compact toolbar replaces all catalogue filter bars. */
.tm-v12-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  width:100%;
  margin:12px 0 18px;
  padding:11px 12px;
  border:1px solid var(--tm12-border);
  border-radius:14px;
  background:#fff;
  box-shadow:0 4px 14px rgba(36,28,19,.035);
}
.tm-v12-total{color:var(--tm12-muted);font-size:14px;white-space:nowrap}
.tm-v12-total strong{color:var(--tm12-ink);font-weight:900}
.tm-v12-toolbar-actions{display:flex;align-items:center;gap:8px;margin-left:auto}
.tm-v12-sort-wrap{
  display:flex;
  align-items:center;
  gap:8px;
  min-height:42px;
  padding:0 10px;
  border:1px solid var(--tm12-border);
  border-radius:11px;
  background:#fff;
}
.tm-v12-sort-wrap>span{font-size:12px;font-weight:800;color:var(--tm12-muted)}
.tm-v12-sort{
  min-height:38px!important;
  max-width:220px;
  margin:0!important;
  padding:5px 28px 5px 5px!important;
  border:0!important;
  outline:0!important;
  background-color:transparent!important;
  color:var(--tm12-ink)!important;
  font-size:13px!important;
  font-weight:800!important;
  box-shadow:none!important;
}
.tm-v12-filter-toggle{
  min-height:42px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  padding:8px 14px;
  border:1px solid var(--tm12-ink);
  border-radius:11px;
  background:var(--tm12-ink);
  color:#fff;
  font-size:13px;
  font-weight:900;
  cursor:pointer;
}

/* Hide native Woo count/order only after JS placed our toolbar successfully. */
.tm-v12-ready .woocommerce-result-count,
.tm-v12-ready .woocommerce-ordering{display:none!important}

/* Hide old/duplicate catalogue filter systems only when positively identified by JS. */
.tm-v12-legacy-filter-hidden{display:none!important}

/* Drawer */
.tm-v12-overlay{
  position:fixed;
  inset:0;
  z-index:999990;
  background:rgba(18,15,12,.48);
  backdrop-filter:blur(2px);
}
.tm-v12-filter-drawer{
  position:fixed;
  z-index:999999;
  top:0;
  left:0;
  width:min(420px,92vw);
  height:100dvh;
  overflow-y:auto;
  overscroll-behavior:contain;
  transform:translateX(-105%);
  transition:transform .25s ease;
  background:#fff;
  box-shadow:24px 0 70px rgba(0,0,0,.20);
}
.tm-v12-filter-drawer.is-open{transform:translateX(0)}
.tm-v12-drawer-head{
  position:sticky;
  z-index:5;
  top:0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:17px 18px;
  border-bottom:1px solid var(--tm12-border);
  background:#fff;
}
.tm-v12-drawer-head strong{display:block;color:var(--tm12-ink);font-size:20px;font-weight:900}
.tm-v12-drawer-head small{display:block;margin-top:2px;color:var(--tm12-muted);font-size:12px}
.tm-v12-filter-close{
  width:40px;
  height:40px;
  border:1px solid var(--tm12-border);
  border-radius:50%;
  background:#fff;
  color:var(--tm12-ink);
  font-size:25px;
  line-height:1;
  cursor:pointer;
}
.tm-v12-filter-form{padding:18px}
.tm-v12-filter-group{padding:0 0 18px;margin:0 0 18px;border-bottom:1px solid var(--tm12-border)}
.tm-v12-filter-group>strong,
.tm-v12-filter-group>label>strong{display:block;margin-bottom:10px;color:var(--tm12-ink);font-size:14px;font-weight:900}
.tm-v12-filter-group select,
.tm-v12-filter-group input[type="number"]{
  width:100%;
  min-height:44px;
  padding:9px 11px;
  border:1px solid var(--tm12-border);
  border-radius:10px;
  background:#fff;
  color:var(--tm12-ink);
  box-shadow:none;
}
.tm-v12-check-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.tm-v12-check{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
  padding:9px 10px;
  border:1px solid var(--tm12-border);
  border-radius:10px;
  background:var(--tm12-ivory);
  color:var(--tm12-ink);
  font-size:12px;
  cursor:pointer;
}
.tm-v12-check span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tm-v12-check input{accent-color:var(--tm12-gold-dark)}
.tm-v12-price-row{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.tm-v12-price-row label span{display:block;margin-bottom:4px;color:var(--tm12-muted);font-size:11px}
.tm-v12-filter-actions{
  position:sticky;
  bottom:0;
  display:grid;
  grid-template-columns:1fr 1.35fr;
  gap:8px;
  padding:12px 0 2px;
  background:#fff;
}
.tm-v12-reset,.tm-v12-apply{
  min-height:45px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:11px;
  text-decoration:none!important;
  font-size:13px;
  font-weight:900;
}
.tm-v12-reset{border:1px solid var(--tm12-border);background:#fff;color:var(--tm12-ink)}
.tm-v12-apply{border:1px solid var(--tm12-ink);background:var(--tm12-ink);color:#fff;cursor:pointer}
body.tm-v12-filter-open{overflow:hidden}

/* Progressive load button; numbered pagination remains as no-JS fallback. */
.tm-v12-load-more-wrap{display:flex;justify-content:center;margin:28px 0 8px}
.tm-v12-load-more{
  min-width:210px;
  min-height:48px;
  padding:10px 20px;
  border:1px solid var(--tm12-ink);
  border-radius:12px;
  background:#fff;
  color:var(--tm12-ink);
  font-size:14px;
  font-weight:900;
  cursor:pointer;
}
.tm-v12-load-more:hover{background:var(--tm12-ink);color:#fff}
.tm-v12-load-more[disabled]{opacity:.55;cursor:wait}
.tm-v12-js nav.woocommerce-pagination{display:none!important}
.tm-v12-live-status{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}

/* Remove common sidebars from catalogue only, keeping full-width browsing. */
@media (min-width:922px){
  .tm-boutique-pro-v12 #secondary,
  .tm-boutique-pro-v12 .widget-area.secondary{display:none!important}
  .tm-boutique-pro-v12 #primary{width:100%!important;max-width:100%!important}
}

@media (max-width:1180px){
  .tm-boutique-pro-v12 ul.products{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:16px!important}
}

@media (max-width:921px){
  .tm-boutique-pro-v12 ul.products{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:11px!important;margin-top:14px!important}
  .tm-v12-toolbar{position:sticky;top:6px;z-index:50;margin:8px 0 14px;padding:8px 9px;border-radius:12px;box-shadow:0 7px 22px rgba(36,28,19,.08)}
  .tm-v12-total{font-size:12px}
  .tm-v12-toolbar-actions{gap:6px}
  .tm-v12-sort-wrap{min-height:40px;padding:0 7px}
  .tm-v12-sort-wrap>span{display:none}
  .tm-v12-sort{max-width:145px;min-height:36px!important;font-size:12px!important;padding-right:22px!important}
  .tm-v12-filter-toggle{min-height:40px;padding:7px 10px;font-size:12px}
  .tm-boutique-pro-v12 #secondary,
  .tm-boutique-pro-v12 .widget-area.secondary{display:none!important}
  .tm-boutique-pro-v12 #primary{width:100%!important}
}

@media (max-width:560px){
  .tm-boutique-pro-v12 ul.products{gap:9px!important}
  .tm-boutique-pro-v12 ul.products li.product{border-radius:13px}
  .tm-boutique-pro-v12 ul.products li.product img{padding:4px}
  .tm-boutique-pro-v12 ul.products li.product .woocommerce-loop-product__title,
  .tm-boutique-pro-v12 ul.products li.product h2{min-height:40px;padding:9px 8px 2px!important;font-size:12.5px!important;line-height:1.28!important}
  .tm-boutique-pro-v12 ul.products li.product .price{padding:3px 8px 7px!important;font-size:13.5px!important}
  .tm-boutique-pro-v12 ul.products li.product .button,
  .tm-boutique-pro-v12 ul.products li.product .tm-v12-card-cta{width:calc(100% - 14px)!important;min-height:39px;margin:auto 7px 7px!important;padding:7px 5px!important;border-radius:9px!important;font-size:10.5px!important}
  .tm-v12-badges{top:6px;left:6px;gap:3px}
  .tm-v12-badge{min-height:20px;padding:3px 6px;font-size:7.8px}
  .tm-v12-toolbar{gap:6px}
  .tm-v12-total{max-width:72px;line-height:1.12;white-space:normal}
  .tm-v12-sort{max-width:112px;font-size:11px!important}
  .tm-v12-filter-toggle{padding:7px 9px}
}

@media (prefers-reduced-motion:reduce){
  .tm-boutique-pro-v12 *{transition:none!important;scroll-behavior:auto!important}
}

/* === V1.3 — ONE FILTER ONLY === */
.tm-boutique-pro-v13 .tm-v13-hidden-filter,
body .tm-v13-hidden-filter{
  display:none!important;
  visibility:hidden!important;
  height:0!important;
  min-height:0!important;
  max-height:0!important;
  overflow:hidden!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
}

/* V1.3 no longer injects Boutique Pro's own drawer. The existing
   TABLEAU MAROC — Filtres Catalogue Thèmes/Intérieur filter is the single source of truth. */
.tm-boutique-pro-v13 #tm-v12-catalog-ui,
.tm-boutique-pro-v13 .tm-v12-toolbar,
.tm-boutique-pro-v13 .tm-v12-filter-drawer,
.tm-boutique-pro-v13 .tm-v12-overlay{
  display:none!important;
}

/* Remove any exact legacy "Nos collections" widget if its theme/plugin leaves a class hook. */
.tm-boutique-pro-v13 [class*="nos-collections" i],
.tm-boutique-pro-v13 [id*="nos-collections" i]{display:none!important;}

/* The one retained filter should not inherit accidental zero-height/hidden legacy styles. */
.tm-boutique-pro-v13 .tm-v13-single-filter{
  display:block;
  visibility:visible;
  height:auto;
  max-height:none;
}


/* V1.4 — remove the complete “Nos collections / Choisissez votre univers” block. */
.tm-boutique-pro-v14 .tm-v14-collections-hidden,
.tm-boutique-pro-v14 [data-tm-v13-reason="collections-universe-section"]{
  display:none!important;
  visibility:hidden!important;
  height:0!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
  overflow:hidden!important;
}
