body.tax-product_cat #main,
body.single-product #main {
  --sgdu-accent: #893235;
  --sgdu-ink: #2b2422;
  --sgdu-line: #e8dcd6;
  --sgdu-surface: #fcf7f4;
}

.sgdu-category-heading h1 {
  margin: 0 0 .55em;
  color: var(--sgdu-ink);
  line-height: 1.22;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

body.tax-product_cat #main .custom-category-nav-container-v7 {
  margin-bottom: 14px;
}

body.tax-product_cat #main .custom-category-nav-container-v7.fouc-loading {
  opacity: 1;
}

.sgdu-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 3px 0 14px;
  color: var(--sgdu-ink);
}

.sgdu-result-count {
  margin-right: auto;
  font-size: .875rem;
  color: #62534d;
}

.sgdu-filter {
  position: relative;
  margin: 0;
}

.sgdu-filter summary,
.sgdu-reset {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  margin: 0;
  padding: 0 11px;
  border: 1px solid var(--sgdu-line);
  border-radius: 8px;
  background: #fff;
  color: var(--sgdu-ink);
  cursor: pointer;
  font-size: .875rem;
  font-weight: 650;
  line-height: 1.25;
  list-style: none;
}

.sgdu-filter summary::-webkit-details-marker { display: none; }

.sgdu-filter summary::after {
  content: '';
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  margin-top: -3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}

.sgdu-filter[open] summary {
  border-color: var(--sgdu-accent);
  color: var(--sgdu-accent);
}

.sgdu-filter[open] summary::after { transform: rotate(225deg); }
.sgdu-reset { color: var(--sgdu-accent); }

.sgdu-filter ul {
  position: absolute;
  z-index: 25;
  top: calc(100% + 5px);
  left: 0;
  width: max-content;
  min-width: 166px;
  max-width: min(220px, calc(100vw - 36px));
  margin: 0;
  padding: 4px;
  border: 1px solid var(--sgdu-line);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 8px 20px rgb(52 34 28 / 14%);
  list-style: none;
}

.sgdu-filter:last-of-type ul { left: auto; right: 0; }
.sgdu-filter li { margin: 0; }

.sgdu-filter li a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 4px 9px;
  border-radius: 5px;
  color: var(--sgdu-ink);
  font-size: .875rem;
  line-height: 1.2;
}

.sgdu-filter li a:hover,
.sgdu-filter li a[aria-current] {
  background: var(--sgdu-surface);
  color: var(--sgdu-accent);
}

.sgdu-toolbar :focus-visible,
.sgdu-recommendations :focus-visible {
  outline: 2px solid var(--sgdu-accent);
  outline-offset: -2px;
}

body.tax-product_cat #main .sgdu-toolbar ~ .custom-top-content {
  margin-top: 20px;
}

.sgdu-purchase .product-price-container .price,
.sgdu-purchase > .price-wrapper .price,
.sgdu-purchase > .price {
  margin: 8px 0 11px;
  color: var(--sgdu-accent);
  font-size: clamp(1.15rem, 2.6vw, 1.65rem);
  line-height: 1.3;
}

.sgdu-purchase .add-to-cart-container {
  scroll-margin-top: 100px;
}

.sgdu-product-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 12px;
}

.sgdu-product-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--sgdu-line);
  border-radius: 8px;
  background: var(--sgdu-surface);
  color: var(--sgdu-accent);
  font-size: .85rem;
  font-weight: 650;
}

.sgdu-recommendations {
  display: grid;
  gap: 16px;
  margin: 12px auto 24px;
}

.sgdu-panel {
  min-width: 0;
  margin: 0;
  padding: 15px;
  border: 1px solid var(--sgdu-line);
  border-radius: 13px;
  background: var(--sgdu-surface);
}

.sgdu-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 11px;
}

.sgdu-panel-header h2 {
  scroll-margin-top: 120px;
  margin: 0;
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
  line-height: 1.24;
  color: var(--sgdu-ink);
}

.sgdu-panel-header a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  color: var(--sgdu-accent);
  font-weight: 700;
  font-size: .875rem;
  line-height: 1.2;
  white-space: nowrap;
}

.sgdu-rail {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.sgdu-card.product-small.box {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--sgdu-line);
  border-radius: 9px;
  background: #fff;
  color: var(--sgdu-ink);
  text-align: left;
}

.sgdu-photo,
.sgdu-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #f3eae5;
}

.sgdu-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
  padding: 9px;
}

.sgdu-card-body h3.product-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  margin: 0;
  font-size: .875rem;
  line-height: 1.33;
}

.sgdu-card-body h3 a { color: var(--sgdu-ink); }
.sgdu-card-body h3 a:hover { color: var(--sgdu-accent); }

.sgdu-card-body .price {
  margin: auto 0 0;
  color: var(--sgdu-accent);
  font-size: .875rem;
  font-weight: 700;
  line-height: 1.3;
}

.sgdu-card-body .price .amount { color: inherit; }

@media (max-width: 849px) {
  .sgdu-rail { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  body.single-product #main .woocommerce-product-gallery__image > a > img:not(.zoomImg) {
    max-height: min(82vw, 360px);
    object-fit: contain;
  }

  body.single-product #main .product-thumbnails .col img {
    max-height: 62px;
    object-fit: contain;
  }

  body.tax-product_cat #main .custom-category-list {
    gap: 8px;
    margin: 0;
    padding: 3px 0 6px;
  }

  body.tax-product_cat #main li.category-item {
    width: 66px;
    margin: 0;
  }

  body.tax-product_cat #main .category-visual-container {
    width: 46px;
    height: 46px;
    margin-bottom: 5px;
  }

  body.tax-product_cat #main .category-name {
    color: #4d3931;
    font-size: .76rem;
    line-height: 1.2;
  }

  body.tax-product_cat #main .category-item.active .category-name {
    color: var(--sgdu-accent);
  }

  body.tax-product_cat #main .category-product-count,
  body.tax-product_cat #main .active-indicator {
    display: none;
  }

  .sgdu-toolbar { gap: 6px; }
  .sgdu-result-count { flex-basis: 100%; order: -2; }
  .sgdu-toolbar:has(.sgdu-reset) .sgdu-result-count { flex: 1 1 calc(100% - 75px); }
  .sgdu-reset { order: -1; }
  .sgdu-filter summary, .sgdu-reset { padding-inline: 8px; font-size: .8rem; }
  .sgdu-recommendations { gap: 10px; padding-inline: 12px; }
  .sgdu-panel { padding: 10px 8px 8px; }

  .sgdu-rail {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 20px) / 2.5);
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    padding-bottom: 5px;
  }

  .sgdu-card { scroll-snap-align: start; }
  .sgdu-card-body { padding: 7px; }
  .sgdu-card-body h3.product-title, .sgdu-card-body .price { font-size: .78rem; }

  .sgmp-ready .mobile-footer-bar .sgmp-single:has(.sgdu-dock-price) {
    flex-direction: column;
    line-height: 1.12;
  }

  .sgdu-dock-price {
    font-size: 10px;
    font-weight: 600;
    margin-top: 2px;
    white-space: nowrap;
  }
}

.sgdu-rail.sgdu-rail-one {
  grid-template-columns: minmax(0, 31rem);
  grid-auto-flow: row;
}

.sgdu-rail-one .sgdu-card.product-small.box {
  display: grid;
  grid-template-columns: minmax(86px, 29%) minmax(0, 1fr);
  align-items: start;
}

.sgdu-pair-reason {
  margin: 0;
  color: #56453e;
  font-size: .81rem;
  line-height: 1.35;
}
