/* Hallmark · v2.0.0 · maintenance · editorial · Россельхозснаб · job: shop */
/* Critique: shared foundations for both pages, with the catalog and shop navigation in their own stylesheets. */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body { margin: 0; line-height: 1.5; }

h2 {
  color: var(--ink);
  font: 700 clamp(1.75rem, 3.2vw, 2.875rem)/1.08 var(--font-body);
  letter-spacing: -.045em;
}

p { margin-block: 0 12px; }

a { color: inherit; text-decoration: none; }

button, input, select, textarea { font: inherit; }

button {
  cursor: pointer;
  color: inherit;
}

button:disabled { cursor: not-allowed; opacity: .58; }

::selection { background: var(--accent); color: var(--accent-ink); }

.skip-link {
  position: fixed;
  inset: 12px auto auto 12px;
  z-index: 30;
  padding: 12px 16px;
  border-radius: var(--control-radius);
  background: var(--accent);
  color: var(--accent-ink);
  clip-path: inset(50%);
}

.skip-link:focus { clip-path: none; }

.preview { text-align: center; font-weight: 600; }

.headinner,
.brand,
.header-address,
.header-phone,
.header-messengers,
.basket-open,
.footinner {
  display: flex;
  align-items: center;
}

.headinner > * { min-width: 0; }

.brand {
  --store-logo-size: 48px;
  gap: 12px;
  line-height: 1.18;
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  font-weight: 700;
}

.brand small,
.header-address small,
.header-phone small { display: block; margin-top: 4px; }

.store-logo {
  display: block;
  flex: none;
  inline-size: var(--store-logo-size);
  block-size: var(--store-logo-size);
  object-fit: contain;
  border-radius: 50%;
}

.header-address,
.header-phone {
  flex: none;
  gap: 12px;
  border-inline-start: 1px solid var(--line);
  padding-inline-start: 20px;
  color: var(--brand-strong);
  font-size: .875rem;
}

.header-address small, .header-phone small { color: var(--muted); font-size: .75rem; }
.header-phone strong { font-size: 1.0625rem; }
.header-address img, .header-phone img { inline-size: 24px; block-size: 24px; }

.header-messengers { flex: none; gap: 12px; margin-inline-start: auto; font-weight: 700; }
.header-messengers a:hover, .header-phone:hover { text-decoration: underline; }

.basket-open {
  flex: none;
  justify-content: center;
  gap: 8px;
  padding-inline: 12px;
  font-size: .875rem;
  font-weight: 700;
  white-space: nowrap;
}

.basket-open img { inline-size: 20px; block-size: 20px; filter: invert(1); }
#cart-count {
  display: inline-grid;
  place-items: center;
  min-inline-size: 24px;
  min-block-size: 24px;
  padding-inline: 4px;
  border-radius: 999px;
  font-size: .8125rem;
  font-variant-numeric: tabular-nums;
}

.site-nav .navinner a {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.site-nav a::after {
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  content: "";
  transform: scaleX(0);
  transform-origin: left;
}

.site-nav a:is([aria-current="page"], :hover, :focus-visible)::after { transform: scaleX(1); }

.hero-inner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  padding-block: clamp(24px, 4vw, 64px);
}

.hero-media {
  min-width: 0;
  width: 100%;
  overflow: clip;
}

.hero-media img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
}

.hero-search,
.hero-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-search { padding: 4px 4px 4px 12px; }
.hero-search > img, .searchbar > img { flex: none; width: 20px; height: 20px; }

.hero-search input,
.searchbar input {
  flex: 1;
  min-width: 0;
  width: 100%;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 1rem;
}

.hero-search input:focus, .searchbar input:focus { outline: none; }
.hero-search button, .searchbar button { border: 0; background: none; }
.hero-search button { padding: 8px clamp(12px, 2vw, 24px); font-weight: 700; }
.hero-search:focus-within { outline: 2px solid var(--focus); outline-offset: 3px; }
.hero-links { flex-wrap: wrap; }
.hero-links a { display: inline-flex; align-items: center; text-decoration: underline; text-underline-offset: .24em; }

.quick-heading > a { display: inline-flex; align-items: center; min-height: 44px; }
.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.featured-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.quick-card:focus-visible, .photo-open:focus-visible { outline-offset: -3px; }

.button,
.featured-add,
.add,
.close {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--control-radius);
  font-weight: 700;
  line-height: 1.28;
  text-align: center;
}

.button, .featured-add { padding: 12px 16px; font-size: .9375rem; }
.green, .featured-add { background: var(--brand); color: var(--canvas); }
.green:hover, .featured-add:hover { background: var(--brand-strong); }
.outline { background: var(--canvas); color: var(--brand-strong); border-color: var(--catalog-control-line); }
.outline:hover { background: var(--row-hover); }
.full { width: 100%; margin-top: 8px; }

#groups, #catalog, #how, #contacts { scroll-margin-block-start: 16px; }
.notice a, .address a, .footinner > a { text-decoration: underline; text-underline-offset: .2em; }
.searchbar #clear-search { min-height: 44px; padding: 8px 12px; font-size: .875rem; }
.searchbar #clear-search:hover { text-decoration: underline; }

.filter-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: start;
}

.filter-button > span:first-child { min-width: 0; }
.filter-button > span:last-child { flex: none; font-variant-numeric: tabular-nums; }
.filter-button:focus-visible { outline-offset: -3px; }

.results-head { display: flex; align-items: center; flex-wrap: wrap; color: var(--muted); }
.results-head label, .mobile-filter label { color: var(--ink); font-size: .875rem; font-weight: 600; }
.catalog-stock-toggle { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; }
.mobile-filter { display: none; }

.product, .featured-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: clip;
}

.product-image, .featured-image {
  display: grid;
  place-items: center;
  min-width: 0;
  position: relative;
  overflow: clip;
}

.featured-image { height: clamp(120px, 14vw, 200px); }

.photo-open {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  width: 100%;
  height: 100%;
}

.photo-open img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
}

.product-content, .featured-copy { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.featured-copy { gap: 8px; padding: 16px; }
.product h3, .featured-copy h3 { flex: 1; }
.featured-copy .featured-add { align-self: start; margin-top: auto; }
.product-bottom { display: flex; justify-content: space-between; }
.price { font-weight: 700; font-variant-numeric: tabular-nums; }
.add { flex: none; padding: 0; font-size: 1.375rem; }
.size-option { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; color: var(--muted); font-size: .875rem; }
.size-option select { width: 100%; min-width: 0; min-height: 44px; padding-inline: 8px; border: 1px solid; }
.photo-note { font-size: .8125rem; }
.catalog-photo-divider { grid-column: 1 / -1; padding-top: 16px; border-top: 1px solid var(--line); font-size: 1.25rem; }
.empty { grid-column: 1 / -1; padding: clamp(16px, 3vw, 32px); color: var(--muted); }
.empty-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.no-image { display: grid; justify-items: center; gap: 8px; text-align: center; font-size: .875rem; }
.no-image-icon { display: grid; place-items: center; }
.no-image-icon svg { fill: none; stroke-width: 2px; stroke-linecap: round; stroke-linejoin: round; }
.more-wrap { display: flex; justify-content: center; margin-top: 24px; }

.contact-actions { display: flex; align-items: center; flex-wrap: wrap; margin-top: 20px; }
.address strong { font-size: 1.375rem; }
.address span, .address strong { display: block; }
.footinner { justify-content: space-between; flex-wrap: wrap; gap: 20px; }
.footer-brand { --store-logo-size: 36px; font-size: 1rem; }
.footer-brand small { font-size: .75rem; font-weight: 600; }

.backdrop { position: fixed; inset: 0; z-index: 20; }

.drawer {
  position: fixed;
  z-index: 21;
  inset: 0 0 0 auto;
  display: flex;
  flex-direction: column;
  width: min(100%, 440px);
  max-width: 100%;
}

.drawer:not(.open) { visibility: hidden; pointer-events: none; }
.drawer-head, .photo-dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.drawer-head h2, .photo-dialog-head h2 { margin: 0; font-size: clamp(1.375rem, 3vw, 2rem); }
.close, .photo-dialog-head button { min-width: 44px; min-height: 44px; padding: 0; font-size: 1.5rem; }
.cart-items { flex: 1; min-height: 0; overflow: auto; margin-block: 16px; }
.cart-item { padding-block: 12px; border-bottom: 1px solid var(--line); }
.cart-item h3 { margin: 0 0 8px; }
.cart-item .code { margin-bottom: 8px; }
.qty-row, .total { display: flex; align-items: center; gap: 8px; }
.qty-row strong { margin-inline-start: auto; }
.qty-row button { min-width: 44px; min-height: 44px; }
.drawer-foot { padding: 16px 0 4px; border-top: 1px solid var(--line); }
.total { justify-content: space-between; margin-bottom: 8px; font-weight: 600; }
.drawer-foot p, .small-note { font-size: .875rem; }
.small-note { display: block; margin-top: 8px; }
.cart-empty { padding-block: 20px; color: var(--muted); }
#order-copy { width: 100%; margin-block: 8px; padding: 8px; border: 1px solid var(--catalog-control-line); border-radius: var(--control-radius); color: var(--ink); resize: vertical; }

.photo-dialog { overflow: auto; }
.photo-dialog img { display: block; width: 100%; height: min(60svh, 516px); object-fit: contain; }
.photo-dialog p { margin-block: 8px 0; }

@media (min-width: 1024px), (min-width: 768px) and (hover: hover) and (pointer: fine) {
  .hero { position: relative; isolation: isolate; }
  .hero-copy { position: relative; z-index: 1; }
  .hero-media { position: absolute; inset: 0; pointer-events: none; }
  .hero-media::after { position: absolute; inset: 0; content: ""; }
  .hero-media img { height: 100%; object-fit: cover; }
}

@media (max-width: 1150px) {
  .header-address { display: none; }
}

@media (max-width: 900px) {
  .header-phone { display: none; }
  .basket-open { margin-inline-start: auto; }
  .mobile-filter { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; }
  .featured-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .header-messengers { display: none; }
  .brand { --store-logo-size: 40px; gap: 8px; font-size: clamp(1rem, 4.2vw, 1.25rem); }
  .featured-copy { padding: 12px; }
  .featured-copy .featured-add { align-self: stretch; }
}

@media (max-width: 360px) {
  .basket-open { padding-inline: 8px; gap: 4px; font-size: .8125rem; }
  .basket-open img { display: none; }
  .brand { --store-logo-size: 36px; }
  .hero-search > img { display: none; }
  .featured-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-copy { animation: reveal-copy 360ms ease-out; }
  .site-nav a::after, .add, .featured-add, .button { transition: transform 160ms ease-out; }
  :is(.add, .featured-add, .button):active { transform: scale(.98); }
  :is(.add, .featured-add)[data-added] { animation: confirm-add 220ms ease-out; }
  .photo-dialog[open], .drawer.open { animation: reveal-copy 200ms ease-out; }

  @keyframes reveal-copy {
    from { opacity: .72; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }

  @keyframes confirm-add {
    45% { transform: scale(.94); }
    100% { transform: scale(1); }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
