/* Sidebar disabled — product grid takes full width. */
body.archive.woocommerce .wp-block-columns {
  display: block !important;
}

body.archive.woocommerce .wp-block-columns > .wp-block-column {
  flex-basis: 100% !important;
  max-width: 100% !important;
}

/* Hide the filter sidebar — full-width product grid only. */
.mk-smart-filters {
  display: none !important;
}

.mk-smart-filters-layout--classic {
  display: block !important;
}

.mk-smart-filters-layout {
  display: block;
  height: 100%;
  margin-top: 0;
}

.mk-smart-filters-layout--classic {
  display: block;
}

.mk-smart-filters {
  position: sticky;
  top: 5rem;
  width: 260px;
}

.mk-smart-filters__form {
  display: grid;
  gap: 0;
  padding: 0;
}

.mk-smart-filters__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.mk-smart-filters__title {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #9a8a7a;
}

.mk-smart-filters__clear {
  color: #2d1f2d;
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mk-smart-filters__section {
  border-top: none;
  border-bottom: 1px solid #ede8e0;
  padding-top: 0;
  padding-bottom: 1rem;
}

.mk-smart-filters__section > summary,
.mk-smart-filters__section-title {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #2d1f2d;
}

.mk-smart-filters__section > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
}

.mk-smart-filters__section > summary::-webkit-details-marker {
  display: none;
}

.mk-smart-filters__section > summary::after {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-right: 2px solid #9a8a7a;
  border-bottom: 2px solid #9a8a7a;
  transform: rotate(45deg);
  transform-origin: center;
  transition: transform 160ms ease;
  flex-shrink: 0;
}

.mk-smart-filters__section[open] > summary::after {
  transform: rotate(-135deg);
}

.mk-smart-filters__terms {
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: #d8d0c4 transparent;
}

.mk-smart-filters__terms::-webkit-scrollbar {
  width: 4px;
}

.mk-smart-filters__terms::-webkit-scrollbar-thumb {
  background: #d8d0c4;
  border-radius: 4px;
}

.mk-smart-filters__terms::-webkit-scrollbar-track {
  background: transparent;
}

.mk-smart-filters__term-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.625rem;
  padding: 0.5rem 0.25rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  font-size: 0.9375rem;
}

.mk-smart-filters__term-label:hover {
  background: #ffffff;
}

/* Custom checkbox — matches Figma rounded with plum check */
.mk-smart-filters__term-label input[type='checkbox'] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  min-width: 22px;
  margin: 0;
  border: 2px solid #c5b8a8;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  flex-shrink: 0;
}

.mk-smart-filters__term-label:hover input[type='checkbox'] {
  border-color: #2d1f2d;
}

.mk-smart-filters__term-label input[type='checkbox']:checked {
  background: #fde5f1;
  border-color: #2d1f2d;
}

.mk-smart-filters__term-label input[type='checkbox']:checked::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 6px;
  width: 7px;
  height: 11px;
  border: solid #2d1f2d;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.mk-smart-filters__term-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  font-weight: 400;
  color: #2d1f2d;
  line-height: 1.4;
  flex: 1;
}

.mk-smart-filters__term-count {
  color: #9a8a7a;
  font-size: 0.875rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.mk-smart-filters__section--price {
  padding-bottom: 0.15rem;
}

.mk-smart-filters__price-range {
  position: relative;
  margin-top: 0.72rem;
  height: 24px;
}

.mk-smart-filters__price-track,
.mk-smart-filters__price-selected {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  border-radius: 999px;
}

.mk-smart-filters__price-track {
  left: 0;
  right: 0;
  background: rgba(30, 31, 37, 0.18);
}

.mk-smart-filters__price-selected {
  left: var(--mk-price-selected-start, 0%);
  width: var(--mk-price-selected-width, 0%);
  background: var(--mk-accent, #fde5f1);
}

.mk-smart-filters__price-range-input {
  -webkit-appearance: none;
  appearance: none;
  accent-color: transparent;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  height: 24px;
  margin: 0;
  pointer-events: none;
  background: transparent;
}

.mk-smart-filters__price-range-input::-webkit-slider-runnable-track {
  height: 4px;
  background: transparent;
}

.mk-smart-filters__price-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border: 2px solid #2d1f2d;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  pointer-events: auto;
}

.mk-smart-filters__price-range-input::-moz-range-track {
  height: 4px;
  background: transparent;
}

.mk-smart-filters__price-range-input::-moz-range-progress {
  height: 4px;
  background: transparent;
}

.mk-smart-filters__price-range-input::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid #2d1f2d;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  pointer-events: auto;
}

.mk-smart-filters__price-range-input::-ms-track {
  height: 4px;
  border-color: transparent;
  color: transparent;
  background: transparent;
}

.mk-smart-filters__price-range-input::-ms-fill-lower,
.mk-smart-filters__price-range-input::-ms-fill-upper {
  background: transparent;
}

.mk-smart-filters__price-fields {
  margin-top: 0.72rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.68rem;
}

.mk-smart-filters__price-field {
  display: grid;
  gap: 0.22rem;
}

.mk-smart-filters__price-field input[type='number'] {
  border: 1px solid rgba(17, 17, 17, 0.6);
  border-radius: 0;
  min-height: 38px;
  padding: 0.35rem 0.55rem;
  background: #ffffff;
}

.mk-smart-filters__price-field span {
  font-size: 0.82rem;
  color: var(--mk-muted, #5a5d69);
}

.mk-smart-filters__status {
  min-height: 1.1rem;
  margin: 0;
  font-size: 0.82rem;
  color: var(--mk-muted, #5a5d69);
}

.mk-smart-filters-layout.is-loading .mk-smart-filters-results,
[data-mk-smart-filters-root].is-loading .mk-smart-filters-results {
  opacity: 0.52;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.mk-smart-filters-layout.is-loading .mk-smart-filters__status::before,
[data-mk-smart-filters-root].is-loading .mk-smart-filters__status::before {
  content: "";
  width: 0.75rem;
  height: 0.75rem;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: #2d1f2d;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.45rem;
  vertical-align: middle;
  animation: mk-smart-filter-spin 700ms linear infinite;
}

.wp-block-column:has(.mk-catalog-empty) {
  display: flex;
  flex-direction: column;
}

.mk-smart-filters-results:has(.mk-catalog-empty) {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 60vh;
}

.mk-smart-filters-results .woocommerce-pagination {
  margin-top: 1.15rem;
}

/* Force 3-column product grid in catalog and smart-filters results. */
.mk-smart-filters-results .wp-block-post-template,
.wp-block-woocommerce-product-template .wp-block-post-template,
.wp-block-post-template.wc-block-product-template {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

@media (max-width: 700px) {
  .mk-smart-filters-results .wp-block-post-template,
  .wp-block-woocommerce-product-template .wp-block-post-template,
  .wp-block-post-template.wc-block-product-template {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 480px) {
  .mk-smart-filters-results .wp-block-post-template,
  .wp-block-woocommerce-product-template .wp-block-post-template,
  .wp-block-post-template.wc-block-product-template {
    grid-template-columns: 1fr !important;
  }
}

.wp-block-woocommerce-catalog-sorting {
  flex: 1 1 auto;
  width: 100%;
}

.mk-catalog-loop-controls {
  margin-bottom: 1.1rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: nowrap;
  width: 100%;
}

.mk-catalog-loop-controls--bottom {
  margin-top: 1.1rem;
  margin-bottom: 0;
}

.mk-catalog-loop-controls__left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: nowrap;
}

.mk-catalog-loop-controls .woocommerce-ordering {
  margin: 0;
  float: none;
}

.mk-catalog-pagination .page-numbers.current {
  font-weight: 600;
  background: var(--mk-accent, #fde5f1);
  color: #2d1f2d;
  border-radius: 8px;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
}

.mk-catalog-pagination .page-numbers:not(.current):hover {
  color: #2d1f2d;
  background: #fde5f1;
  border-radius: 8px;
}

.mk-catalog-pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
  font-size: 18px;
}

.mk-catalog-pagination .wp-block-query-pagination-numbers {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mk-catalog-pagination .wp-block-query-pagination-next,
.mk-catalog-pagination .wp-block-query-pagination-previous {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  line-height: 1;
}

.mk-smart-filters-results li:is(.wp-block-post.product, .wc-block-product.product) {
  display: flex;
  flex-direction: column;
}

.mk-catalog-product-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4px 20px 20px;
  margin-top: 0;
}

.mk-catalog-add-to-cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 30px;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 8px;
  background: rgba(45, 31, 45, 0.9);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.mk-catalog-add-to-cart span {
  display: inline;
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
}

.mk-catalog-add-to-cart:hover,
.mk-catalog-add-to-cart:focus {
  color: #fff;
  border-color: transparent;
  background: #2d1f2d;
  box-shadow: none;
  transform: none;
}

.mk-catalog-add-to-cart:focus {
  outline: 2px solid rgba(59, 130, 246, 0.45);
  outline-offset: 1px;
}

.mk-catalog-add-to-cart.loading,
.mk-catalog-add-to-cart[aria-disabled='true'] {
  opacity: 0.75;
  cursor: progress;
}

.mk-catalog-add-to-cart.added {
  border-color: transparent;
  background: #2d1f2d;
  box-shadow: none;
  color: #fff;
}

/* Direct compatibility for provided reference markup. */
.filters-top {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.km-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  min-width: 160px;
  padding: 10px 16px;
  border: 1px solid #000;
  background-color: #ffffff;
  cursor: pointer;
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 14px;
  line-height: 1;
  text-transform: none;
}

.km-select::after {
  content: "▾";
  margin-left: 12px;
  font-size: 10px;
}

.km-select select {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.km-pagination {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 18px;
}

.km-pagination a {
  color: #000;
  text-decoration: none;
}

.km-pagination .is-active {
  color: #2d1f2d;
}

.km-pagination .ellipsis {
  pointer-events: none;
}

.km-pagination .next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  cursor: pointer;
}

@keyframes mk-smart-filter-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Empty state ── */
.mk-catalog-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  flex: 1;
}

.mk-catalog-empty__icon {
  color: hsl(340 15% 70%);
  margin-bottom: 2rem;
  opacity: 0.5;
  width: 64px;
  height: 64px;
}

.mk-catalog-empty__text {
  color: hsl(340 15% 50%);
  font-size: 1.125rem;
  line-height: 1.7;
  max-width: 26rem;
  margin: 0;
}

@media (max-width: 1000px) {
  .wp-block-columns:has(.mk-smart-filters-layout) {
    flex-wrap: wrap !important;
    gap: 1rem;
  }

  .wp-block-columns:has(.mk-smart-filters-layout) > .wp-block-column {
    flex-basis: 100% !important;
    width: 100%;
  }

  .mk-smart-filters-layout {
    display: block;
    width: 100%;
  }

  .mk-smart-filters-results {
    min-width: 0;
    width: 100%;
  }

  .mk-smart-filters {
    position: static;
    width: 100%;
  }

  .mk-catalog-loop-controls {
    flex-wrap: wrap !important;
    align-items: flex-start;
    gap: 0.8rem;
  }

  .mk-catalog-loop-controls .kl-toolbar__left {
    width: 100%;
    flex-wrap: nowrap;
  }

  .mk-catalog-loop-controls .kl-toolbar__left .woocommerce-ordering {
    flex: 1 1 0;
    min-width: 0;
  }

  .mk-catalog-loop-controls .kl-toolbar__left .woocommerce-ordering .kl-select,
  .mk-catalog-loop-controls .kl-toolbar__left .woocommerce-ordering select {
    width: 100%;
    min-width: 0;
  }

  .mk-catalog-loop-controls .mk-catalog-pagination {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 980px) {
  .mk-smart-filters-layout--classic {
    grid-template-columns: 1fr;
  }

  .mk-smart-filters {
    position: static;
  }

  .mk-smart-filters__terms {
    max-height: none;
  }

  .mk-catalog-loop-controls {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .mk-catalog-loop-controls .woocommerce-ordering .orderby,
  .mk-catalog-loop-controls .mk-catalog-per-page select {
    min-height: 40px;
    font-size: 14px;
    padding: 8px 32px 8px 14px;
  }

  .mk-catalog-pagination ul.page-numbers {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.5rem;
  }

  .mk-catalog-add-to-cart {
    min-height: 32px;
    padding: 0.45rem 0.85rem;
    font-size: 0;
  }

  .mk-catalog-add-to-cart span {
    font-size: 0.82rem;
  }
}

