.sp-catalogue-tools,
.sp-purchase-panel {
  --sp-ink: #24262a;
  --sp-muted: #4e5560;
  --sp-red: #b52323;
  --sp-focus: #a51e1e;
  --sp-border: #e0e2e5;
  box-sizing: border-box;
  color: var(--sp-ink);
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

.sp-catalogue-tools {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
  gap: 22px;
  margin: 14px 0 26px;
  padding: clamp(16px, 3vw, 28px);
  background: #faf8f7;
  border: 1px solid var(--sp-border);
  border-radius: 14px;
}

.sp-catalogue-tools h2 {
  margin: 0 0 8px;
  color: var(--sp-ink);
  font-family: inherit;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 750;
  line-height: 1.18;
  text-transform: none;
}

.sp-catalogue-intro p {
  margin: 0;
  color: var(--sp-muted);
  font-size: 16px;
}

.sp-catalogue-form { min-width: 0; margin: 0; }
.sp-catalogue-form label { display: block; margin: 0 0 5px; color: var(--sp-ink); font-size: 16px; font-weight: 680; }
.sp-search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }

.sp-catalogue-tools .sp-catalogue-form :is(input, select):not([type=hidden]) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  height: auto;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #747780;
  border-radius: 8px;
  background: #fff;
  color: var(--sp-ink);
  font: inherit;
  box-shadow: none;
}

.sp-catalogue-tools .button.sp-catalogue-button {
  box-sizing: border-box;
  min-height: 46px;
  margin: 0;
  padding: 8px 13px;
  border: 1px solid var(--sp-red);
  border-radius: 8px;
  background: var(--sp-red) !important;
  color: #fff !important;
  font-family: inherit;
  font-size: 16px;
  font-weight: 680;
  line-height: 1.3;
  text-transform: none;
  white-space: normal;
}

.sp-catalogue-tools .button.sp-catalogue-button:hover { background: #981a1a !important; }
.sp-catalogue-tools :is(a,button,input,select,summary):focus-visible,
.sp-purchase-panel :is(a,button,input,select):focus-visible {
  outline: 3px solid var(--sp-focus) !important;
  outline-offset: 3px;
}

.sp-filters { margin-top: 9px; }
.sp-filters summary {
  cursor: pointer;
  min-height: 44px;
  padding: 9px 0;
  color: var(--sp-focus);
  font-size: 16px;
  font-weight: 730;
}

.sp-filters summary::marker { color: var(--sp-focus); }
.sp-filter-grid { min-width: 0; }
.sp-filter-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 13px; margin-top: 12px; }
.sp-filter-actions a { display: inline-flex; align-items: center; min-height: 44px; color: var(--sp-focus); text-decoration: underline; font-weight: 680; }

.sp-purchase-panel {
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid var(--sp-border);
  border-radius: 14px;
  background: #faf8f7;
}

.sp-purchase-panel h2 { color: var(--sp-ink); font-family: inherit; font-size: 20px; font-weight: 730; line-height: 1.3; margin: 0 0 7px; }

.sp-product-mode {
  display: inline-block;
  margin: 0 0 6px;
  padding: 4px 9px;
  border-radius: 6px;
  background: #f1e9e8;
  color: #742121;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.25;
}

body.single-product div.product .summary .sp-purchase-panel p.price { margin: 4px 0 8px; }
.sp-purchase-panel .sp-product-unit { margin: 0 0 9px; color: var(--sp-muted); font-size: 16px; }
.woocommerce ul.products li.product .sp-product-unit { margin: 0 0 8px; color: #4e5560; font-size: 15px; }
.sp-quote-price { font-weight: 720; }
.sp-tax-label { font-size: .85em; white-space: nowrap; }
body.single-product div.product .summary .sp-purchase-panel form.cart { margin: 9px 0 0; padding: 0; }
.sp-purchase-panel form.cart .quantity input.qty { min-height: 44px; }
.sp-purchase-panel .single_add_to_cart_button { max-width: 100%; min-height: 44px; font-size: 16px; line-height: 1.3; white-space: normal; }
.sp-quantity-field { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 8px 7px 0; }
.sp-quantity-field > span { font-size: 16px; font-weight: 690; }
.sp-quantity-field:not(:has(input:not([type=hidden]))) > span { display: none; }

body.single-product div.product a.woocommerce-product-gallery__trigger {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid #747780;
  background-color: #fff;
  color: #24262a;
}

body .navbar button.navbar-toggle {
  box-sizing: border-box;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid #747780;
  background-color: #fff;
}

body .navbar button.navbar-toggle .icon-bar { background-color: #24262a; }
body .navbar :is(a,button):focus-visible { outline: 3px solid #a51e1e; outline-offset: 2px; }

@media (max-width: 930px) {
  .sp-catalogue-tools { grid-template-columns: minmax(0, 1fr); gap: 13px; }
}

@media (max-width: 520px) {
  .sp-search-row { grid-template-columns: minmax(0, 1fr); }
  .sp-catalogue-tools { margin-block: 10px 18px; }
}

/* Category introduction uses the same warm, two-column layout as Par événement. */
body.tax-product_cat .sp-category-header {
  box-sizing: border-box;
  padding: 100px 0 22px;
  background: linear-gradient(125deg, #fbf8f8, #fff9f6 55%, #fff);
  color: #24262a;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
body.tax-product_cat .sp-category-header-grid {
  display: grid;
  gap: clamp(16px, 4vw, 46px);
  align-items: center;
}
body.tax-product_cat .sp-category-header-grid.has-image {
  grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
}
.sp-category-header-grid::before,
.sp-category-header-grid::after {
  display: none !important;
}
.sp-category-header-copy {
  max-width: 64ch;
  min-width: 0;
}
body.tax-product_cat .sp-category-header h1 {
  margin: 0;
  color: #24262a;
  font-family: inherit;
  font-size: clamp(29px, 3.3vw, 44px);
  font-weight: 800;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.sp-category-description {
  margin-top: 12px;
  color: #4e5560;
  font-size: 16px;
  line-height: 1.55;
}
.sp-category-description p {
  margin: 0 0 9px;
}
.sp-category-description a {
  color: #8a2121;
  text-decoration: underline;
}
.sp-category-header-image {
  position: relative;
  justify-self: end;
  width: min(100%, 350px);
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border: 1px solid #eee;
  border-radius: 14px;
  background: #f4f3f1;
}
.sp-category-header-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sp-category-header-image.is-product-photo img {
  padding: 12px;
  object-fit: scale-down;
}
body.tax-product_cat .sp-category-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 8px;
  padding: 6px 12px;
  border: 1px solid #dbbfbf;
  border-radius: 8px;
  background: white;
  color: #8a2121;
  font-size: 15px;
  font-weight: 720;
}
body.tax-product_cat .sp-category-back:hover {
  text-decoration: underline;
}
body.tax-product_cat .sp-category-back:focus-visible {
  outline: 3px solid #a51e1e;
  outline-offset: 3px;
}
body.tax-product_cat main > .sp-category-header + .main .blog-post {
  padding-top: 12px;
}
body.tax-product_cat main > .sp-category-header + .main .before-shop-main {
  margin: 8px 0 12px;
}
body.tax-product_cat .sp-catalogue-tools {
  margin: 6px 0 18px;
  padding: 14px 18px;
}
body.tax-product_cat .sp-catalogue-tools .sp-filters {
  margin-top: 3px;
}
@media (max-width: 700px) {
  body.tax-product_cat .sp-category-header {
    padding-top: 90px;
    padding-bottom: 16px;
  }
  body.tax-product_cat .sp-category-header-grid.has-image {
    grid-template-columns: minmax(0, 1fr);
  }
  .sp-category-header-image {
    justify-self: start;
    width: min(100%, 265px);
  }
}

/* Align the archive photo with the proportions of its catalogue tile. */
body.tax-product_cat .sp-category-header-image {
  width: min(100%, 440px);
  background: #f4f3f1;
  border: 0;
  box-shadow: none;
}
body.tax-product_cat .sp-category-header-image img {
  margin: 0;
  border: 0;
  box-shadow: none;
}
@media (max-width: 700px) {
  body.tax-product_cat .sp-category-header-image {
    justify-self: stretch;
    width: min(100%, 440px);
  }
}

@media (max-width: 991px) {
  .before-shop-main > .row > :is(div:has(> .woocommerce-ordering), div:has(> .woocommerce-result-count)) {
    float: none;
    width: 100%;
    min-width: 0;
  }
  .before-shop-main .woocommerce-result-count {
    float: none;
    margin: 0 0 8px;
    line-height: 1.45;
  }
  .before-shop-main .woocommerce-ordering {
    float: none;
    width: min(100%, 380px);
    min-width: 0;
    margin: 0 0 12px;
  }
  .before-shop-main .woocommerce-ordering select.orderby,
  .sp-catalogue-tools .sp-catalogue-form select {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 44px;
    font-size: 16px;
    line-height: 1.4;
    text-transform: none;
    padding-inline: 10px 28px;
  }
}
@media (max-width: 599px) {
  .before-shop-main .woocommerce-ordering { width: 100%; }
}

.sp-catalogue-tools .sp-catalogue-form input[type="search"],
.sp-catalogue-tools .sp-catalogue-form select {
  border: 1px solid #747780 !important;
  border-radius: 12px !important;
}
.sp-catalogue-tools .sp-catalogue-form select {
  appearance: none;
  padding: 8px 38px 8px 12px !important;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23742121' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 15px center !important;
}
.sp-catalogue-active-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin: 0 0 9px;
}
.sp-catalogue-active-filter a { color: var(--sp-focus); text-decoration: underline; }

.sp-catalogue-complement { margin: 0 0 14px; }
.sp-catalogue-complement a { color: #742121; text-decoration: underline; font-weight: 680; }
