/* Navigation and standalone store pages share the catalogue's warm palette. */
:root {
  --store-wash: #fff9e6;
  --store-border: #eae6d8;
  --store-text-muted: #656a5e;
}

.store-skip-link {
  position: absolute;
  z-index: 60;
  top: 6px;
  left: 6px;
  transform: translateY(-150%);
  padding: 9px 14px;
  border-radius: 6px;
  background: var(--yellow);
  color: var(--ink);
}
.store-skip-link:focus { transform: none; }
#main-content:focus { outline: none; }

.topline { background: #faf8ee; }
.topline-right { align-items: center; }
.topline-right a, .footer-main a, .store-departments a,
.brand, .category-filter, .category-tile, .section-mini a,
.hero .dark-button, .business-banner .dark-button,
.suggestion, .product-name, .product-card .add-button {
  color: inherit;
  text-decoration: none;
}
.topline-right a:hover, .footer-main a:not(.brand):hover, .section-mini a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.hero .dark-button, .business-banner .dark-button { color: #fff; }
.hero-copy h1 { max-width: 640px; }
.header-main {
  display: grid;
  grid-template-columns: max-content max-content minmax(0, 1fr) max-content;
  height: 88px;
}
.header-main .brand { flex: none; }
.header-main .catalog-button { white-space: nowrap; }
.header-main .search { min-width: 0; }
.header-main .header-actions { margin: 0; gap: clamp(8px, 1.3vw, 20px); }
.header-actions .header-action {
  display: flex;
  min-width: 43px;
  height: auto;
  padding: 5px 3px;
  border-radius: 7px;
  color: var(--ink);
}
.header-actions .header-action[aria-current='page'] { background: var(--store-wash); }
.header-actions .header-action:hover { color: #876300; }
.header-actions .header-action > span:last-child { display: block; color: inherit; }
.header-actions .cart-header { padding-inline: 9px; background: var(--store-wash); }
.header-actions .cart-header[aria-current='page'] { background: #fff0ad; }

.store-departments { height: 44px; gap: clamp(18px, 2.4vw, 34px); }
.store-departments a {
  flex: none;
  align-self: stretch;
  display: grid;
  align-items: center;
  border-bottom: 3px solid transparent;
  font-size: 13px;
}
.store-departments a:is(:hover, [aria-current='page']) { border-bottom-color: var(--yellow); }
.store-departments a[aria-current='page'] { font-weight: 700; }

.catalog-menu {
  grid-template-columns: minmax(190px, 26%) minmax(0, 1fr);
  gap: 0;
  max-height: min(67vh, 570px);
  padding: 0;
  overflow: hidden;
}
.mega-departments, .mega-groups { min-width: 0; overflow: auto; padding: 16px; }
.mega-departments { background: #fbfaf4; border-right: 1px solid var(--store-border); }
.mega-departments .mega-all, .mega-departments button, .mega-title, .mega-group-links a {
  color: var(--ink);
  text-decoration: none;
}
.mega-departments .mega-all, .mega-departments button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
}
.mega-all { margin-bottom: 5px; font-weight: 700; }
.mega-departments button[aria-pressed='true'], .mega-departments a:hover { background: #ffefae; }
.mega-departments small, .mega-group-links small { color: var(--store-text-muted); font-size: 10px; }
.mega-groups { padding: 21px 24px; }
.mega-title { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 16px; font-size: 20px; font-weight: 700; }
.mega-group-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px 12px; }
.mega-group-links a { border-radius: 5px; padding: 6px 7px; overflow-wrap: anywhere; }
.mega-title:hover, .mega-group-links a:hover { background: var(--store-wash); }
.mega-family + .mega-family { margin-top: 13px; border-top: 1px solid var(--store-border); padding-top: 12px; }
.mega-family h3 { margin: 0 0 5px; font-size: 14px; }
.department-families { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 20px; align-items: start; }
.department-families details { border: 1px solid var(--store-border); background: #fff; border-radius: 8px; }
.department-families details[open] { background: var(--store-wash); }
.department-families summary { cursor: pointer; padding: 9px 11px; font-weight: 600; }
.department-families small { color: var(--store-text-muted); font-weight: normal; margin-left: 3px; }
.department-families .mega-group-links { grid-template-columns: 1fr; padding: 0 7px 8px; }

.category-tiles { grid-template-columns: repeat(9, minmax(0, 1fr)); }
.category-tile { font-size: 12px; font-weight: 600; }
.category-tile small { color: var(--store-text-muted); font-size: 10px; }
.store-crumbs { margin-bottom: 16px; color: var(--store-text-muted); font-size: 12px; }
.store-crumbs ol { display: flex; gap: 7px 10px; flex-wrap: wrap; padding: 0; margin: 0; list-style: none; }
.store-crumbs li { display: flex; gap: 10px; align-items: center; overflow-wrap: anywhere; min-width: 0; }
.store-crumbs li:not(:last-child)::after { content: '›'; color: #797c6a; }
.store-crumbs a { color: inherit; text-decoration: none; }
.store-crumbs a:hover { text-decoration: underline; }
.store-crumbs [aria-current='page'] { color: var(--ink); }

[data-page='catalog'] .catalog-section { margin: 24px 0 56px; }
[data-page='catalog'] .categories-section { margin-top: 24px; }
.catalog-heading h2 { font-size: clamp(22px, 3vw, 36px); font-weight: 700; overflow-wrap: anywhere; }
.group-chips a {
  padding: 7px 10px;
  border: 1px solid var(--store-border);
  border-radius: 8px;
  color: var(--ink);
  font-size: 11px;
  text-decoration: none;
}
.group-chips a small { color: var(--store-text-muted); margin-left: 3px; }
.group-chips a:is(.selected, :hover) { background: var(--store-wash); border-color: #ded2a8; }
.product-card { min-width: 0; }
.product-card .price-evidence { color: #5f633a; font-size: 10px; }
.product-card .product-name { overflow-wrap: anywhere; }
.reference-badge { color: #575544; }
.suggestion { overflow-wrap: anywhere; }
.suggestion > .icon, .suggestion > img { flex: none; }

.store-page { min-height: 52vh; padding: 24px 0 58px; }
.store-page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.store-page-heading h1 { margin: 0; font-size: clamp(27px, 4vw, 42px); line-height: 1.13; letter-spacing: -.035em; overflow-wrap: anywhere; }
.store-page-heading p { margin: 7px 0 0; color: var(--store-text-muted); }
.store-page a:is(.light-button,.yellow-button) { text-decoration: none; }
.store-page .empty-state h2 { margin: 0; font-size: 21px; }
.store-page .empty-state .yellow-button { margin-top: 12px; }
.store-page-loading { padding: 30px; background: var(--store-wash); border-radius: 12px; }
.store-more { margin-top: 20px; }
.store-photo-zoom { margin: 0; text-align: center; }
.store-photo-zoom img { display: block; width: 100%; height: min(62vh, 620px); object-fit: contain; }
.photo-unavailable::after { content: 'Фото недоступно'; font-size: 8px; }

.store-cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 310px); align-items: start; gap: 24px; }
.store-cart-list, .store-estimate-list { border: 1px solid var(--store-border); border-radius: 12px; background: #fff; }
.store-cart-line {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) 106px minmax(84px, max-content);
  align-items: start;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--store-border);
}
.store-cart-line:last-child, .store-estimate-row:last-child { border-bottom: 0; }
.cart-line-photo {
  display: grid;
  place-items: center;
  height: 84px;
  border: 1px solid var(--studio-ring);
  border-radius: 9px;
  background: var(--studio-surface) var(--studio-backdrop) center / cover;
  padding: 9px;
}
.cart-line-photo img, .cart-line-photo svg, .cart-line-photo .reference-visual { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; mix-blend-mode: multiply; }
.cart-line-details a, .store-estimate-row a:not(.light-button), .store-estimate-detail a:not(.light-button), .store-compare .compare-item a {
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.cart-line-details > a { font-size: 14px; font-weight: 700; }
.cart-line-details a:hover, .store-estimate-row a:hover, .store-estimate-detail a:hover, .store-compare .compare-item a:hover { text-decoration: underline; }
.cart-line-details p, .cart-line-quantity small { margin: 6px 0; color: var(--store-text-muted); font-size: 12px; }
.cart-price-source { display: flex; flex-wrap: wrap; gap: 5px; align-items: baseline; color: var(--store-text-muted); font-size: 11px; }
.cart-price-source .price-evidence, .store-compare .price-evidence, .store-estimate-detail .price-evidence { font-size: 11px; color: #53582e; }
.cart-line-quantity .qty-control { gap: 2px; border: 1px solid var(--store-border); }
.cart-line-quantity .qty-control button { flex: 0 0 25px; }
.qty-control input {
  width: 100%;
  min-width: 0;
  padding: 3px 1px;
  text-align: center;
  border: 0;
  background: transparent;
  appearance: textfield;
}
.qty-control input::-webkit-inner-spin-button { appearance: none; }
.cart-line-quantity small { display: block; text-align: center; }
.cart-line-end { display: grid; gap: 7px; justify-items: end; }
.cart-line-end strong { white-space: nowrap; font-size: 15px; }
.cart-line-end .icon-button { min-width: 35px; min-height: 35px; }
.qty-control button:disabled, .store-page button:disabled { cursor: default; opacity: .5; }
.store-checkout-summary {
  position: sticky;
  top: 14px;
  background: var(--store-wash);
  border: 1px solid var(--store-border);
  padding: 19px;
  border-radius: 12px;
}
.store-checkout-summary h2 { margin: 0 0 14px; font-size: 20px; }
.store-checkout-summary .total-row { gap: 9px; }
.store-checkout-summary .total-row.big { border-top: 1px solid var(--store-border); margin-top: 11px; padding-top: 12px; font-size: 17px; }
.store-checkout-summary .total-row:last-child span:last-child { text-align: right; }
.store-checkout-summary p { color: var(--store-text-muted); font-size: 12px; }
.store-checkout-summary .yellow-button { width: 100%; justify-content: space-between; margin-bottom: 12px; }
.store-checkout-summary a { color: var(--ink); font-size: 12px; }
.store-cart-actions, .store-service-actions { display: flex; flex-wrap: wrap; column-gap: 9px; row-gap: 8px; align-items: center; }
.store-cart-actions { margin-top: 15px; }
.clear-cart-link { margin-left: auto; }

.store-compare { background: #fff; border: 1px solid var(--store-border); border-radius: 12px; }
.store-compare .compare-table { width: 100%; border-collapse: collapse; }
.store-compare .compare-table .compare-item { min-width: 175px; text-align: left; font-weight: normal; }
.store-compare .compare-item strong { display: block; margin: 8px 0 12px; }
.store-compare .compare-item img, .store-compare .compare-item svg { display: block; margin-inline: auto; }
.store-compare .compare-item .icon { display: inline-block; }
.store-compare .compare-item .text-button { display: block; margin-top: 6px; }

.store-estimate-row { display: grid; grid-template-columns: 41px minmax(0,1fr) auto auto; gap: 13px; align-items: center; padding: 16px; border-bottom: 1px solid var(--store-border); }
.store-estimate-row h2 { margin: 0; font-size: 17px; overflow-wrap: anywhere; }
.store-estimate-row p { margin: 4px 0 0; font-size: 12px; color: var(--store-text-muted); }
.store-estimate-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 9px; background: var(--store-wash); }
.store-estimate-detail { padding: 18px; border: 1px solid var(--store-border); border-radius: 12px; background: #fff; }
.store-estimate-detail small { display: block; margin-top: 3px; color: var(--store-text-muted); }
.store-estimate-detail .store-estimate-total { display: flex; gap: 14px; justify-content: flex-end; margin-bottom: 11px; font-size: 17px; }
.store-estimate-detail .data-table th, .store-estimate-detail .data-table td { text-align: left; }

.store-services { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.store-services section { padding: 21px; border: 1px solid var(--store-border); border-radius: 11px; background: #fff; }
.store-services section:first-child { background: var(--store-wash); }
.store-services h2 { margin: 0; font-size: 20px; }
.store-services p { color: var(--store-text-muted); }
.footer-main { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; }
.footer-main > div { gap: 7px; margin: 0; }
.footer-main > div strong { font-size: 13px; }
.footer-main > div a { font-size: 12px; color: var(--store-text-muted); }
.footer-bottom { color: var(--store-text-muted); }

@media (max-width: 1050px) {
  .store-cart-line { grid-template-columns: 68px minmax(0,1fr) 102px auto; padding: 13px; gap: 11px; }
  .cart-line-photo { height: 68px; }
  .mega-group-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .topline-right { gap: 11px; font-size: 10px; }
  .topline-right a:nth-child(2), .topline-right a:nth-child(3) { display: none; }
  .header-main { grid-template-columns: max-content minmax(0,1fr); grid-template-rows: auto auto; gap: 10px; height: auto; padding-block: 11px; }
  .header-main .brand { grid-column: 1; grid-row: 1; }
  .header-main .header-actions { grid-column: 2; grid-row: 1; display: flex; gap: 4px; justify-content: flex-end; }
  .header-actions .header-action:nth-child(3) { display: flex; }
  .header-actions .header-action { min-width: 33px; }
  .header-main .catalog-button { grid-column: 1; grid-row: 2; position: static; width: auto; height: 41px; gap: 7px; padding: 0 11px; }
  .header-main .catalog-button span { display: block; }
  .header-main .search { grid-column: 2; grid-row: 2; width: 100%; min-width: 0; height: 41px; margin: 0; }
  .store-departments { height: 37px; gap: 18px; }
  .store-departments a { font-size: 12px; }
  .mega-departments, .mega-groups { padding: 9px; }
  .catalog-menu { grid-template-columns: minmax(112px, 39%) minmax(0, 1fr); }
  .mega-departments .mega-all, .mega-departments button, .mega-group-links a { font-size: 11px; }
  .mega-title { font-size: 14px; }
  .mega-group-links { grid-template-columns: 1fr; }
  .department-families { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .group-chips a { flex: none; }
  .store-page { padding: 17px 0 36px; min-height: 48vh; }
  .store-cart-layout { grid-template-columns: 1fr; gap: 14px; }
  .store-checkout-summary { position: static; }
  .clear-cart-link { margin-left: 0; }
  .footer-main { grid-template-columns: 1fr 1fr; gap: 17px; }
  .footer-main > div { width: auto; }
}
@media (max-width: 460px) {
  .header-main .brand { gap: 6px; font-size: 24px; }
  .header-main .brand-mark { width: 31px; height: 31px; border-radius: 8px; }
  .header-main .brand-mark svg { width: 24px; height: 24px; }
  .header-main .brand-caption { font-size: 7px; }
  .header-actions .header-action > span:last-child, .header-actions .account-header > span:last-child { display: none; }
  .header-actions .header-action { padding-inline: 3px; min-width: 32px; min-height: 35px; }
  .header-actions .cart-header { padding-inline: 5px; }
  .store-services { grid-template-columns: 1fr; }
  .department-families { grid-template-columns: 1fr; }
  .store-cart-line { grid-template-columns: 64px minmax(0,1fr) auto; gap: 8px 10px; }
  .cart-line-photo { grid-row: 1 / 3; height: 64px; }
  .cart-line-details { grid-column: 2 / -1; }
  .cart-line-quantity { grid-column: 2; width: min(100%, 112px); }
  .cart-line-end { grid-column: 3; gap: 4px; }
  .store-estimate-row { grid-template-columns: 30px minmax(0,1fr) auto; padding: 12px; gap: 9px; }
  .store-estimate-icon { width: 30px; height: 32px; }
  .store-estimate-row > .light-button { grid-column: 2; justify-self: start; }
  .store-estimate-row > .icon-button { grid-column: 3; grid-row: 1 / 3; }
}
@media print {
  body[data-page='estimates'] :is(.store-skip-link, .topline, .header, footer, .store-cart-actions, .store-crumbs, .store-page-heading > a, .toast) { display: none !important; }
  body[data-page='estimates'] { background: #fff; }
  .store-estimate-detail { border: 0; padding: 0; }
  .store-estimate-detail .compare-wrap { overflow: visible; }
}
