:root {
  color-scheme: light;
  --bg: #eef3f8;
  --surface: #ffffff;
  --surface-strong: #edf5ff;
  --surface-warm: #fff7e0;
  --ink: #101828;
  --muted: #667085;
  --line: #d7e1ee;
  --line-strong: #b7c7dc;
  --navy: #071426;
  --blue: #075dcc;
  --blue-dark: #073b8f;
  --cyan: #00a6ff;
  --red: #e83f4f;
  --green: #06835f;
  --amber: #f3b428;
  --violet: #6d5dfc;
  --shadow: 0 18px 40px rgba(21, 47, 94, 0.12);
  --shadow-strong: 0 24px 60px rgba(8, 25, 52, 0.18);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(238, 243, 248, 0.72) 360px),
    linear-gradient(90deg, rgba(7, 93, 204, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(7, 93, 204, 0.05) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 48px 48px, 48px 48px, auto;
  color: var(--ink);
  min-width: 320px;
}

body::selection {
  background: rgba(0, 166, 255, 0.22);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

body.has-overlay {
  overflow: hidden;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none !important;
}

img {
  display: block;
  max-width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-shell {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 18px 18px 28px;
}

.site-header {
  position: sticky;
  top: 10px;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(183, 199, 220, 0.72);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 16px 45px rgba(8, 25, 52, 0.12);
  backdrop-filter: blur(18px);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.brand-logo {
  width: 220px;
  height: 78px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(7, 47, 120, 0.12));
}

.search-wrap input,
.filters-panel select,
.select-label select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

.search-wrap input {
  padding: 0 18px 0 46px;
  background:
    linear-gradient(90deg, transparent 0 40px, rgba(215, 225, 238, 0.9) 40px 41px, transparent 41px),
    var(--surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 10px 26px rgba(10, 43, 94, 0.08);
}

.search-wrap {
  position: relative;
}

.search-wrap::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 50%;
  width: 13px;
  height: 13px;
  border: 2px solid var(--blue-dark);
  border-radius: 999px;
  transform: translateY(-56%);
  pointer-events: none;
}

.search-wrap::after {
  content: "";
  position: absolute;
  left: 30px;
  top: 29px;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: var(--blue-dark);
  transform: rotate(45deg);
  pointer-events: none;
}

.search-wrap input:focus,
.filters-panel select:focus,
.select-label select:focus,
.filters-panel input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(0, 166, 255, 0.16);
}

.cart-toggle,
.primary-button,
.ghost-button,
.load-more,
.small-button,
.qty-button,
.icon-button {
  border: 0;
  border-radius: 8px;
  min-height: 42px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.cart-toggle:hover,
.primary-button:hover,
.ghost-button:hover,
.load-more:hover,
.small-button:hover,
.qty-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.cart-toggle {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: #fff;
  box-shadow: 0 12px 26px rgba(7, 93, 204, 0.24);
}

.cart-count {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: #fff;
  color: var(--blue-dark);
  font-weight: 800;
}

.shop-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 480px);
  gap: 22px;
  align-items: center;
  margin: 18px 0;
  padding: clamp(20px, 4vw, 38px);
  overflow: hidden;
  border: 1px solid rgba(125, 165, 220, 0.3);
  border-radius: 18px;
  background:
    linear-gradient(120deg, rgba(7, 20, 38, 0.96), rgba(7, 42, 90, 0.94) 58%, rgba(7, 93, 204, 0.84)),
    var(--navy);
  color: #fff;
  box-shadow: var(--shadow-strong);
  isolation: isolate;
}

.shop-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(115deg, transparent 0 52%, rgba(255, 255, 255, 0.08) 52% 52.4%, transparent 52.4%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 56px);
  opacity: 0.65;
}

.hero-copy {
  min-width: 0;
}

.hero-subtitle {
  max-width: 620px;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1rem;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 900;
  text-decoration: none;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.hero-link:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.16);
}

.hero-link.primary {
  border-color: transparent;
  background: #fff;
  color: var(--blue-dark);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.22);
}

.hero-visual {
  display: grid;
  gap: 12px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 5.3rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.shop-hero h1 {
  max-width: 760px;
  color: #fff;
  text-wrap: balance;
}

.hero-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  align-self: end;
  min-height: 104px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);
}

.hero-panel div {
  display: grid;
  align-content: center;
  justify-items: center;
  min-width: 0;
  padding: 14px 10px;
  background: rgba(255, 255, 255, 0.1);
}

.hero-panel span {
  color: #fff;
  font-size: clamp(1.4rem, 2.4vw, 2.2rem);
  font-weight: 900;
}

.hero-panel small {
  color: rgba(255, 255, 255, 0.68);
  font-weight: 700;
  text-transform: uppercase;
}

.hero-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.hero-product {
  display: grid;
  grid-template-rows: 74px auto;
  gap: 7px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-align: left;
  backdrop-filter: blur(10px);
}

.hero-product img {
  width: 100%;
  height: 74px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
}

.hero-product span {
  display: -webkit-box;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.18;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.shop-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.filters-panel,
.catalog-panel {
  border: 1px solid rgba(183, 199, 220, 0.78);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(28, 58, 110, 0.1);
}

.filters-panel {
  position: sticky;
  top: 116px;
  padding: 14px;
  background:
    linear-gradient(180deg, #ffffff, #f8fbff),
    var(--surface);
}

.filters-summary {
  display: none;
}

.filters-content {
  display: grid;
  gap: 16px;
}

.filter-title {
  display: grid;
  gap: 3px;
  padding: 10px 10px 12px;
  border: 1px solid rgba(215, 225, 238, 0.78);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(7, 93, 204, 0.08), rgba(255, 255, 255, 0.98)),
    #fff;
}

.filter-title h2 {
  margin: 0;
  color: #172033;
  font-size: 1.25rem;
  line-height: 1;
}

.filter-block {
  display: grid;
  gap: 10px;
}

.filter-heading {
  color: #26364f;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-button {
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #2e3b50;
  font-size: 0.84rem;
  font-weight: 800;
  box-shadow: 0 7px 16px rgba(8, 25, 52, 0.05);
}

.pill-button.is-active {
  border-color: var(--blue);
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: #fff;
}

.range-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.range-row span {
  color: var(--green);
  font-weight: 900;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--blue);
}

.ghost-button {
  padding: 0 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, var(--surface-strong));
  color: var(--blue-dark);
  font-weight: 900;
}

.catalog-panel {
  min-width: 0;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.98)),
    var(--surface);
}

.catalog-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: -2px -2px 12px;
}

.catalog-summary article {
  display: grid;
  gap: 3px;
  min-width: 0;
  min-height: 74px;
  align-content: center;
  padding: 12px;
  border: 1px solid rgba(215, 225, 238, 0.78);
  border-radius: 12px;
  background: #fff;
}

.catalog-summary span {
  overflow: hidden;
  color: var(--blue-dark);
  font-size: 1.18rem;
  font-weight: 950;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-summary small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.catalog-toolbar {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  margin: -2px -2px 14px;
  padding: 10px 12px;
  border: 1px solid rgba(215, 225, 238, 0.78);
  border-radius: 12px;
  background: #fff;
}

.catalog-toolbar strong {
  display: block;
  font-size: 1.08rem;
}

.catalog-toolbar span,
.select-label span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.select-label {
  display: flex;
  gap: 8px;
  align-items: center;
}

.select-label select {
  min-width: 190px;
  padding: 0 12px;
  background: #f8fbff;
}

.status-bar {
  display: none;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #bdd8ff;
  border-radius: 8px;
  background: #edf6ff;
  color: var(--blue-dark);
  font-weight: 800;
}

.status-bar.is-visible {
  display: block;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.product-card {
  position: relative;
  display: grid;
  grid-template-rows: 210px 1fr;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(215, 225, 238, 0.96);
  border-radius: 16px;
  background:
    linear-gradient(180deg, #ffffff, #fbfdff),
    #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.product-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--blue), var(--amber));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: #9eb8dc;
  box-shadow: 0 22px 38px rgba(21, 47, 94, 0.16);
}

.product-card:hover::before {
  opacity: 1;
}

.image-button {
  width: 100%;
  height: 210px;
  padding: 16px;
  border: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(237, 245, 255, 0.88)),
    repeating-linear-gradient(135deg, rgba(7, 93, 204, 0.06) 0 1px, transparent 1px 12px);
}

.image-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.22s ease;
}

.product-card:hover .image-button img {
  transform: scale(1.035);
}

.card-body {
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 9px;
  min-width: 0;
  padding: 14px;
}

.category-line {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef6ff;
  color: var(--blue-dark);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.product-card h3 {
  display: -webkit-box;
  min-height: 48px;
  margin: 0;
  overflow: hidden;
  color: #172033;
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: 0;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.subcategory-line {
  display: -webkit-box;
  min-height: 32px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
}

.price {
  color: var(--green);
  font-size: 1.18rem;
  font-weight: 950;
}

.stock {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.stock::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(6, 131, 95, 0.12);
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.small-button {
  padding: 0 10px;
  border: 1px solid transparent;
  background: #eaf2ff;
  color: var(--blue-dark);
  font-weight: 900;
  white-space: nowrap;
}

.small-button.primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: #fff;
}

.load-more {
  display: block;
  width: min(280px, 100%);
  margin: 18px auto 0;
  padding: 0 18px;
  background: linear-gradient(135deg, #172033, #0a2d5f);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 14px 30px rgba(8, 25, 52, 0.18);
}

.load-more[hidden] {
  display: none;
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(12, 24, 45, 0.44);
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 50;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(440px, 100%);
  height: 100dvh;
  background:
    linear-gradient(180deg, #ffffff, #f8fbff),
    #fff;
  box-shadow: -18px 0 48px rgba(11, 28, 58, 0.24);
  transform: translateX(105%);
  transition: transform 0.24s ease;
}

.cart-drawer.is-open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.drawer-header h2 {
  margin: 0;
  font-size: 1.55rem;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  min-width: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: #25304a;
  font-weight: 900;
}

.cart-items {
  overflow: auto;
  padding: 14px;
}

.empty-state {
  display: grid;
  grid-column: 1 / -1;
  place-items: center;
  min-height: 200px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.cart-line {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.cart-line img {
  width: 74px;
  height: 74px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7f9fc;
}

.cart-line h3 {
  margin: 0 0 6px;
  font-size: 0.96rem;
  line-height: 1.2;
}

.cart-line-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.qty-controls {
  display: inline-grid;
  grid-template-columns: 34px 36px 34px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.qty-button {
  min-height: 34px;
  border-radius: 0;
  background: #eef4ff;
  color: var(--blue-dark);
  font-weight: 900;
}

.qty-controls span {
  text-align: center;
  font-weight: 900;
}

.cart-footer {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #f0f6ff);
}

.checkout-form {
  display: grid;
  gap: 10px;
}

.checkout-form label {
  display: grid;
  gap: 5px;
  color: #26364f;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.checkout-form input,
.checkout-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.checkout-form input {
  min-height: 42px;
  padding: 0 12px;
}

.checkout-form textarea {
  min-height: 76px;
  padding: 10px 12px;
  resize: vertical;
}

.checkout-form input:focus,
.checkout-form textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(0, 166, 255, 0.16);
}

.checkout-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.35;
}

.checkout-status[data-tone="success"] {
  color: var(--green);
}

.checkout-status[data-tone="error"] {
  color: var(--red);
}

.cart-secondary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.1rem;
}

.primary-button {
  padding: 0 16px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: #fff;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(7, 93, 204, 0.22);
}

.product-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(12, 24, 45, 0.5);
}

.product-modal.is-open {
  display: grid;
}

.modal-card {
  position: relative;
  width: min(960px, 100%);
  max-height: min(760px, calc(100dvh - 36px));
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 16px;
  background:
    linear-gradient(180deg, #ffffff, #f8fbff),
    #fff;
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

.modal-body {
  display: grid;
  grid-template-columns: minmax(260px, 42%) minmax(0, 1fr);
  gap: 20px;
  padding: 24px;
}

.modal-image {
  display: grid;
  place-items: center;
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(237, 245, 255, 0.9)),
    repeating-linear-gradient(135deg, rgba(7, 93, 204, 0.06) 0 1px, transparent 1px 12px);
}

.modal-image img {
  width: 100%;
  max-height: 440px;
  object-fit: contain;
  padding: 18px;
}

.modal-copy {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding-right: 42px;
}

.modal-price-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.product-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.product-facts span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--blue-dark);
  font-size: 0.82rem;
  font-weight: 900;
}

.modal-copy h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  line-height: 1.05;
}

.modal-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.source-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--blue-dark);
  font-weight: 900;
  text-decoration: none;
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .search-wrap {
    grid-column: 1 / -1;
  }

  .shop-hero,
  .shop-layout,
  .modal-body {
    grid-template-columns: 1fr;
  }

  .filters-panel {
    position: static;
  }

  .modal-copy {
    padding-right: 0;
  }
}

@media (hover: none) {
  .cart-toggle:hover,
  .primary-button:hover,
  .ghost-button:hover,
  .load-more:hover,
  .small-button:hover,
  .qty-button:hover,
  .icon-button:hover,
  .hero-link:hover,
  .hero-product:hover,
  .product-card:hover {
    transform: none;
  }
}

@media (max-width: 760px) {
  .page-shell {
    padding: 0 10px 14px;
  }

  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    top: 0;
    padding: 8px;
    border-radius: 0 0 14px 14px;
  }

  .brand-logo {
    width: 148px;
    height: 54px;
  }

  .cart-toggle {
    min-height: 40px;
    padding: 0 10px;
  }

  .cart-count {
    min-width: 26px;
    height: 26px;
  }

  .search-wrap {
    grid-column: 1 / -1;
  }

  .search-wrap input,
  .filters-panel select,
  .select-label select {
    min-height: 44px;
  }

  .search-wrap input {
    padding: 0 12px 0 46px;
  }

  .shop-hero {
    gap: 14px;
    margin: 12px 0;
    padding: 16px;
    border-radius: 14px;
  }

  h1 {
    font-size: 1.85rem;
    line-height: 1.02;
  }

  .eyebrow {
    margin-bottom: 5px;
    font-size: 0.68rem;
  }

  .hero-subtitle {
    margin-top: 10px;
    font-size: 0.9rem;
    line-height: 1.45;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 14px;
  }

  .hero-link {
    min-height: 42px;
    padding: 0 10px;
    font-size: 0.86rem;
  }

  .hero-visual {
    gap: 9px;
  }

  .hero-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-height: 68px;
    box-shadow: none;
  }

  .hero-panel div {
    padding: 8px 4px;
  }

  .hero-panel span {
    font-size: 1.05rem;
  }

  .hero-panel small {
    font-size: 0.62rem;
  }

  .hero-strip {
    display: flex;
    gap: 8px;
    margin-inline: -16px;
    overflow-x: auto;
    padding: 0 16px 2px;
    scrollbar-width: none;
  }

  .hero-strip::-webkit-scrollbar {
    display: none;
  }

  .hero-product {
    flex: 0 0 112px;
    grid-template-rows: 68px auto;
    padding: 7px;
  }

  .hero-product img {
    height: 68px;
  }

  .shop-layout {
    gap: 10px;
  }

  .filters-panel {
    display: block;
    overflow: hidden;
    padding: 0;
  }

  .filters-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 48px;
    padding: 0 12px;
    color: #172033;
    font-weight: 950;
    list-style: none;
    cursor: pointer;
  }

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

  .filters-summary::after {
    content: "+";
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: var(--surface-strong);
    color: var(--blue-dark);
    font-size: 1.2rem;
    line-height: 1;
  }

  .filters-panel[open] .filters-summary::after {
    content: "-";
  }

  .filters-summary small {
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .filters-content {
    gap: 12px;
    padding: 0 12px 12px;
  }

  .filter-title {
    display: none;
  }

  .pill-list {
    flex-wrap: nowrap;
    margin-inline: -12px;
    overflow-x: auto;
    padding: 0 12px 4px;
    scrollbar-width: none;
  }

  .pill-list::-webkit-scrollbar {
    display: none;
  }

  .pill-button {
    flex: 0 0 auto;
    min-height: 38px;
    white-space: nowrap;
  }

  .catalog-panel {
    padding: 10px;
  }

  .catalog-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 10px;
  }

  .catalog-summary article {
    min-height: 62px;
    padding: 8px;
  }

  .catalog-summary span {
    font-size: 0.92rem;
  }

  .catalog-summary small {
    font-size: 0.6rem;
  }

  .catalog-toolbar {
    display: grid;
    gap: 10px;
    min-height: 0;
    margin-bottom: 10px;
  }

  .select-label {
    align-items: start;
    flex-direction: column;
  }

  .select-label select {
    min-width: 0;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .product-card {
    grid-template-rows: clamp(126px, 38vw, 160px) 1fr;
  }

  .image-button {
    height: 100%;
    padding: 8px;
  }

  .card-body {
    gap: 7px;
    padding: 10px;
  }

  .category-line {
    min-height: 14px;
    overflow: hidden;
    font-size: 0.62rem;
    letter-spacing: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .product-card h3 {
    min-height: 40px;
    font-size: 0.88rem;
    line-height: 1.16;
  }

  .subcategory-line {
    display: none;
  }

  .price-row {
    display: block;
  }

  .price {
    font-size: 1rem;
  }

  .stock {
    display: none;
  }

  .small-button {
    min-height: 40px;
    padding: 0 6px;
    font-size: 0.84rem;
  }

  .card-actions {
    grid-template-columns: 1fr;
  }

  .card-actions .small-button:first-child {
    display: none;
  }

  .small-button.primary {
    font-size: 0.8rem;
  }

  .load-more {
    min-height: 46px;
  }

  .cart-drawer {
    width: 100%;
  }

  .drawer-header,
  .cart-footer {
    padding: 14px;
  }

  .cart-items {
    padding: 10px 14px;
  }

  .product-modal {
    align-items: end;
    padding: 0;
  }

  .modal-card {
    width: 100%;
    max-height: 92dvh;
    border-radius: 8px 8px 0 0;
  }

  .modal-body {
    gap: 14px;
    padding: 18px;
  }

  .modal-image {
    min-height: 260px;
  }

  .modal-copy {
    gap: 10px;
  }

  .modal-copy h2 {
    font-size: 1.45rem;
  }

  .product-facts span {
    min-height: 30px;
    font-size: 0.76rem;
  }

  .modal-actions {
    display: grid;
  }

  .source-link,
  .primary-button,
  .ghost-button {
    min-height: 44px;
  }
}

@media (max-width: 340px) {
  .catalog-summary {
    grid-template-columns: 1fr;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }
}

/* Category tree sidebar */
.category-tree {
  display: grid;
  gap: 4px;
}

.tree-group {
  display: grid;
  gap: 4px;
}

.tree-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #2e3b50;
  font-size: 0.86rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.tree-item span:not(.tree-caret) {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-item em {
  flex: 0 0 auto;
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 800;
  color: #7a8aa3;
  background: #eef4ff;
  border-radius: 999px;
  padding: 2px 8px;
}

.tree-item:hover {
  background: #f2f6fd;
  border-color: var(--line);
}

.tree-item.is-active {
  border-color: var(--blue);
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: #fff;
}

.tree-item.is-active em {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.tree-caret {
  flex: 0 0 12px;
  color: #7a8aa3;
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.15s ease;
}

.tree-group.is-open > .tree-root .tree-caret {
  transform: rotate(90deg);
}

.tree-item.is-active .tree-caret {
  color: #fff;
}

.tree-children {
  display: grid;
  gap: 2px;
  margin-left: 14px;
  padding-left: 10px;
  border-left: 2px solid var(--line);
}

.tree-child {
  min-height: 34px;
  font-size: 0.82rem;
  font-weight: 600;
}

@media (max-width: 760px) {
  .category-tree {
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
  }
}

/* ==========================================================
   FINAL LAYOUT CORRECTIONS
   Keep this section at the very bottom of the CSS file.
   ========================================================== */

/* Main website container */
.page-shell {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 12px 0 32px;
}

/* Keep the header in the normal document flow */
.site-header {
  position: sticky !important;
  top: 10px;
  z-index: 100;

  width: 100%;
  margin: 0 0 18px;
}

/* Prevent the hero from appearing underneath the header */
.shop-hero {
  position: relative;
  width: 100%;
  margin: 0 0 18px;
  min-height: 370px;
}

/* Main catalog layout */
.shop-layout {
  display: grid;
  grid-template-columns: minmax(250px, 290px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  width: 100%;
}

/* Prevent grid children from forcing their columns wider */
.filters-panel,
.catalog-panel,
.filters-content,
.filter-block,
.filter-title,
.category-tree,
.tree-group,
.tree-children,
.catalog-summary,
.catalog-toolbar,
.product-grid {
  min-width: 0;
  max-width: 100%;
}

/* Sidebar correction */
.filters-panel {
  position: sticky;
  top: 116px;

  width: 100%;
  padding: 14px;
  overflow: hidden;
}

.filters-content {
  width: 100%;
}

.filter-title {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  overflow: hidden;
}

.filter-title h2,
.filter-title p,
.filter-title span {
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* Category list correction */
.category-tree,
.tree-group {
  width: 100%;
}

.tree-item {
  display: flex;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.tree-item span:not(.tree-caret) {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-item em {
  flex-shrink: 0;
}

.tree-children {
  width: calc(100% - 14px);
  margin-left: 14px;
}

/* Catalog correction */
.catalog-panel {
  width: 100%;
  overflow: hidden;
}

.catalog-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  margin: 0 0 12px;
}

.catalog-summary article {
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.catalog-summary span {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-toolbar {
  width: 100%;
  margin: 0 0 14px;
}

/* Correct product card sizing */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
}

.product-card {
  width: 100%;
  min-width: 0;
}

.image-button {
  width: 100%;
  overflow: hidden;
}

.image-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Medium desktop and tablet */
@media (max-width: 1200px) {
  .page-shell {
    width: min(1100px, calc(100% - 24px));
  }

  .shop-layout {
    grid-template-columns: 250px minmax(0, 1fr);
  }

  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Tablet */
@media (max-width: 980px) {
  .page-shell {
    width: calc(100% - 24px);
  }

  .site-header {
    top: 6px;
  }

  .shop-hero {
    min-height: auto;
  }

  .shop-layout {
    grid-template-columns: 1fr;
  }

  .filters-panel {
    position: static;
    top: auto;
  }

  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Mobile */
@media (max-width: 760px) {
  .page-shell {
    width: 100%;
    padding: 0 10px 16px;
  }

  .site-header {
    top: 0;
    margin-bottom: 12px;
  }

  .shop-hero {
    margin-bottom: 12px;
    min-height: auto;
  }

  .filters-panel {
    width: 100%;
    padding: 0;
  }

  .filters-content {
    padding: 0 12px 12px;
  }

  .catalog-panel {
    padding: 10px;
  }

  .catalog-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .catalog-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

/* Very small phones */
@media (max-width: 380px) {
  .catalog-summary {
    grid-template-columns: 1fr;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }
}