:root {
  --commerce-accent: #f2a65b;
  --commerce-ink: #552415;
}

.site-nav .nav-button {
  min-height: 32px;
  height: 32px;
  border-color: var(--commerce-accent);
  border-radius: 6px;
  padding: 0 14px;
  color: var(--commerce-ink);
  background: var(--commerce-accent);
  white-space: nowrap;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.site-nav .nav-button:hover,
.site-nav .nav-button:focus-visible {
  color: var(--commerce-ink);
  background: #f6b878;
  box-shadow: 0 6px 14px rgba(85, 36, 21, .14);
  transform: translateY(-1px);
}

.site-logo-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  height: 46px;
  text-decoration: none;
}

.site-logo-link img {
  display: block;
  width: auto;
  height: 46px;
}

.nav-main-group,
.nav-account-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-spacer {
  flex: 1 1 auto;
  min-width: 18px;
}

.cart-nav-button {
  gap: 7px;
}

.cart-nav-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: #fff;
}

.filter-group summary,
.filter-option,
.catalog-section summary,
.catalog-section-items a {
  transition: color .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.filter-group {
  margin-bottom: 4px;
  padding: 2px 0;
  border-top: 0;
  border-bottom: 0;
}

.filter-group summary {
  box-sizing: border-box;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #d3d5d3;
  border-radius: 8px;
  background: #f5f5f2;
  cursor: pointer;
}

.filter-group summary:hover,
.filter-group summary:focus-visible {
  color: var(--commerce-ink);
  border-color: #bfc2bf;
  background: #e9e9e6;
  box-shadow: 0 3px 9px rgba(85, 36, 21, .08);
  transform: translateY(-1px);
}

.filter-group[open] summary {
  border-color: #c6c8c6;
  background: #eeeeeb;
}

.catalog-section summary:hover,
.catalog-section summary:focus-visible {
  color: var(--commerce-ink);
  background: rgba(242, 166, 91, .16);
}

.filter-option:hover,
.catalog-section-items a:hover {
  color: var(--commerce-ink);
  background: rgba(242, 166, 91, .11);
  transform: translateX(2px);
}

/* Keep crawlable product links in HTML without flashing a partial catalog. */
.product-grid > .seo-product-links {
  display: none;
}

.product-grid:has(> .seo-product-links)::before {
  display: block;
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
  text-align: center;
  content: "Загружаем каталог…";
}

.product-grid > .seo-product-links .seo-product-card {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(20, 30, 24, .04);
  text-decoration: none;
}

.product-grid > .seo-product-links .seo-product-card > img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #eef0eb;
}

.product-grid > .seo-product-links .seo-product-card__body {
  display: grid;
  gap: 9px;
  padding: 12px;
  line-height: 1.3;
}

.product-grid > .seo-product-links .seo-product-card__body strong {
  min-height: 44px;
  font-size: 15px;
}

.product-grid > .seo-product-links .seo-product-card__body span {
  color: #673519;
  font-size: 1.14rem;
  font-weight: 800;
}

.catalog-market-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 10px 0 8px;
}

.catalog-market-row .order-wb-link {
  flex: 0 0 auto;
  margin: 0;
}

.catalog-site-price-block {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  text-align: right;
}

.catalog-site-price-label {
  color: #72655b;
  font-size: .88rem;
  font-weight: 700;
  line-height: 1.05;
}

.catalog-site-price {
  color: #673519;
  font: 800 clamp(2.2rem, 5vw, 3.2rem)/1 system-ui, sans-serif;
  letter-spacing: -.04em;
  line-height: 1;
  white-space: nowrap;
}

.catalog-site-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 14px 0 0;
}

.catalog-site-action {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--commerce-accent);
  border-radius: 8px;
  padding: 9px 14px;
  color: var(--commerce-ink);
  background: #fff;
  font: inherit;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.catalog-site-action--primary {
  color: var(--commerce-ink);
  background: var(--commerce-accent);
}

.catalog-site-action--details {
  color: var(--commerce-ink);
  background: #fff;
}

.catalog-site-action:hover {
  color: var(--commerce-ink);
  filter: brightness(.97);
}

.buyer-link-list {
  display: grid;
  gap: 9px;
  margin: 16px 0 24px;
  padding: 0;
  list-style: none;
}

.buyer-link-list a {
  display: flex;
  min-height: 42px;
  box-sizing: border-box;
  align-items: center;
  border: 1px solid var(--commerce-accent);
  border-radius: 8px;
  padding: 9px 14px;
  color: var(--commerce-ink);
  background: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.buyer-link-list a:hover,
.buyer-link-list a:focus-visible {
  color: var(--commerce-ink);
  background: #fff4e8;
  box-shadow: 0 7px 16px rgba(85, 36, 21, .12);
  text-decoration: none;
  transform: translateY(-1px);
}

.wb-exit-dialog {
  width: min(470px, calc(100% - 32px));
  box-sizing: border-box;
  padding: 24px;
  border: 1px solid #ead3c0;
  border-radius: 16px;
  color: var(--commerce-ink);
  background: #fffdf9;
  box-shadow: 0 24px 70px rgba(55, 30, 18, .28);
}

.wb-exit-dialog::backdrop {
  background: rgba(35, 24, 18, .52);
}

.wb-exit-dialog h2 { margin: 0 0 10px; font-size: 1.35rem; }
.wb-exit-dialog p { margin: 0; line-height: 1.5; }
.wb-exit-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.wb-exit-actions button {
  min-height: 42px;
  border: 1px solid var(--commerce-accent);
  border-radius: 8px;
  padding: 9px 15px;
  color: var(--commerce-ink);
  background: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.wb-exit-actions button:hover,
.wb-exit-actions button:focus-visible { background: #fff4e8; box-shadow: 0 6px 14px rgba(85, 36, 21, .12); transform: translateY(-1px); }
.wb-exit-actions .wb-exit-confirm { background: var(--commerce-accent); }

.secondary-action:has(.wb-inline-mark) {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.wb-inline-mark {
  display: inline-block;
  flex: 0 0 30px;
  width: 30px;
  height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, #f300c7, #7d20e8);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 22px;
  text-align: center;
  vertical-align: middle;
}
.wb-inline-mark::after { content: "WB"; }

.catalog-site-action:disabled {
  cursor: wait;
  opacity: .65;
}

.catalog-cart-editor {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(110px, 160px) 44px minmax(150px, 1fr);
  gap: 9px;
  align-items: end;
  padding: 12px;
  border: 1px solid #f4d1ae;
  border-radius: 10px;
  background: #fff8ec;
}

.catalog-quantity-label {
  display: grid;
  gap: 5px;
  color: var(--commerce-ink);
  font-size: 12px;
  font-weight: 700;
}

.catalog-quantity {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--commerce-accent);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--commerce-ink);
  background: white;
  font: inherit;
  font-size: 16px;
}

.catalog-cart-remove {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid #c73535;
  border-radius: 8px;
  color: #b52222;
  background: #fff;
  cursor: pointer;
}

.catalog-cart-remove:hover {
  background: #fff0f0;
}

.catalog-cart-remove svg {
  width: 23px;
  height: 23px;
  fill: currentColor;
}

.catalog-site-unavailable,
.catalog-cart-status {
  grid-column: 1 / -1;
  margin: 0;
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--muted);
  background: var(--chip);
  line-height: 1.45;
}

.catalog-cart-status {
  color: #8e2020;
  background: #f9e7e7;
}

.catalog-site-action[hidden],
.catalog-cart-editor[hidden],
.catalog-site-unavailable[hidden],
.catalog-cart-status[hidden],
.catalog-site-price-block[hidden] {
  display: none;
}

@media (max-width: 1100px) {
  .site-nav .nav-button {
    font-size: 12px;
  }
}

@media (max-width: 620px) {
  .catalog-site-actions {
    grid-template-columns: 1fr;
  }

  .catalog-cart-editor {
    grid-column: auto;
    grid-template-columns: 1fr 44px;
  }

  .catalog-cart-link {
    grid-column: 1 / -1;
  }

  .catalog-market-row {
    gap: 10px;
  }

  .catalog-site-price-block {
    gap: 7px;
  }

  .catalog-site-price {
    font-size: clamp(1.75rem, 9vw, 2.35rem);
  }

  .nav-main-group,
  .nav-account-group {
    flex-wrap: wrap;
  }
}
