@font-face {
  font-family: "B Yekan";
  src: url("/static/fonts/b-yekan.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #24213f;
  --muted: #716d85;
  --line: #e3e0ef;
  --surface: #ffffff;
  --surface-soft: #f7f5fc;
  --primary: #7658ed;
  --primary-dark: #5b3fd0;
  --accent: #ffad32;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(45, 33, 93, 0.12);
  font-family: "B Yekan", Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--surface-soft);
  font-size: 16px;
  line-height: 1.65;
}
body.gallery-open { overflow: hidden; }

button, input, select, textarea {
  font: inherit;
  font-family: "B Yekan", Tahoma, Arial, sans-serif;
}
option { font-family: "B Yekan", Tahoma, Arial, sans-serif; }
button, a { -webkit-tap-highlight-color: transparent; }

.shell {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  inset: 12px auto auto 12px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: 10px;
  color: #fff;
  background: var(--ink);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: relative;
  z-index: 5;
  border-bottom: 1px solid rgba(255,255,255,.12);
  color: #fff;
  background: #221447;
}

.header-inner {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}
.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, #9b6cff, #6651e6 70%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.brand-mark svg { width: 30px; height: 30px; }
.brand strong { display: block; font-size: 1.2rem; line-height: 1.25; }
.brand small { display: block; color: #d2cce8; font-size: .75rem; }
.beta-badge {
  padding: 5px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  color: #e7e1fb;
  background: rgba(255,255,255,.06);
  font-size: .78rem;
}
.beta-badge b { color: #fff; font-family: Arial, sans-serif; letter-spacing: .04em; }
.beta-badge span { padding-right: 8px; border-right: 1px solid rgba(255,255,255,.2); direction: ltr; }

.hero {
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 16% 8%, rgba(118,88,237,.62), transparent 34%),
    radial-gradient(circle at 87% 78%, rgba(34,211,238,.18), transparent 30%),
    #221447;
}

.hero-grid {
  min-height: 490px;
  padding-block: 72px 80px;
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  align-items: center;
  gap: clamp(34px, 7vw, 92px);
}

.eyebrow {
  margin: 0 0 10px;
  color: #75e6d3;
  font-size: .84rem;
  font-weight: 800;
  letter-spacing: .02em;
}

h1 {
  margin: 0;
  max-width: 650px;
  font-size: clamp(2.1rem, 5vw, 4.15rem);
  line-height: 1.2;
  letter-spacing: -.04em;
}
h1 span { color: #cfc3ff; }
.hero-description {
  max-width: 590px;
  margin: 24px 0 0;
  color: #ded8ef;
  font-size: 1.08rem;
}

.search-panel {
  padding: 28px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 24px;
  background: rgba(255,255,255,.08);
  box-shadow: 0 30px 80px rgba(0,0,0,.18);
  backdrop-filter: blur(12px);
}
.search-panel label {
  display: block;
  margin-bottom: 10px;
  font-size: .95rem;
  font-weight: 800;
}
.search-row { display: flex; gap: 10px; }
.input-wrap { position: relative; flex: 1; }
.input-wrap svg {
  position: absolute;
  top: 50%;
  right: 17px;
  width: 23px;
  height: 23px;
  color: #718096;
  transform: translateY(-50%);
  pointer-events: none;
}
.input-wrap input {
  width: 100%;
  min-height: 58px;
  padding: 0 50px 0 16px;
  border: 2px solid transparent;
  border-radius: 14px;
  outline: none;
  color: var(--ink);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.input-wrap input:focus {
  border-color: #a78bfa;
  box-shadow: 0 0 0 4px rgba(167,139,250,.18);
}
.input-wrap input::placeholder { color: #8a98aa; }
.primary-button {
  min-width: 112px;
  min-height: 58px;
  padding: 0 22px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #8062f2, #6748dc);
  font-weight: 800;
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.primary-button:hover { background: linear-gradient(135deg, #7050e7, #5637c8); transform: translateY(-1px); }
.primary-button:focus-visible { outline: 3px solid #fde68a; outline-offset: 3px; }
.primary-button:disabled { cursor: wait; opacity: .8; transform: none; }
.button-spinner { display: none; width: 20px; height: 20px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.is-loading .button-label { display: none; }
.is-loading .button-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(1turn); } }
.input-help { margin: 9px 2px 0; color: #bfccdb; font-size: .81rem; }

.examples {
  margin-top: 18px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: #cbd8e5;
  font-size: .82rem;
}
.examples button, .suggestions button {
  padding: 6px 11px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  color: inherit;
  background: rgba(255,255,255,.08);
  cursor: pointer;
}
.examples button:hover { color: #fff; background: rgba(255,255,255,.16); }

.trust-strip {
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.trust-grid {
  min-height: 108px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
}
.trust-grid > div {
  min-height: 58px;
  padding-inline: 28px;
  display: flex;
  align-items: center;
  gap: 13px;
  border-left: 1px solid var(--line);
}
.trust-grid > div:last-child { border-left: 0; }
.trust-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--primary);
  background: #f0ebff;
  font-weight: 900;
}
.trust-grid p { margin: 0; }
.trust-grid strong, .trust-grid span { display: block; }
.trust-grid p span { color: var(--muted); font-size: .82rem; }

.results-shell { min-height: 0; padding-block: 0; }
.results-shell.is-active { min-height: 280px; padding-block: 64px 88px; }
.status-card {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 22px;
  border: 1px solid #fecaca;
  border-radius: 16px;
  color: var(--danger);
  background: #fff6f5;
  text-align: center;
}
.loading-area > p { margin: 24px 0 0; color: var(--muted); text-align: center; }
.loading-heading { margin-bottom: 24px; display: flex; justify-content: space-between; }
.skeleton { display: block; height: 24px; border-radius: 8px; background: #e6ebf1; animation: pulse 1.3s ease-in-out infinite; }
.skeleton.wide { width: 300px; }
.skeleton.short { width: 110px; }
.skeleton-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.skeleton-card { height: 270px; border-radius: 20px; background: #e6ebf1; animation: pulse 1.3s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .48; } }

.results-header {
  margin-bottom: 26px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}
.results-header h2 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.15rem); line-height: 1.35; }
.results-header .eyebrow { color: var(--primary); }
.results-summary { margin: 8px 0 0; color: var(--muted); }
.cache-badge { padding: 6px 12px; border-radius: 999px; color: #4b349a; background: #ece7ff; font-size: .8rem; white-space: nowrap; }

.suggestions {
  margin: 0 0 24px;
  padding: 15px 17px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  border: 1px solid #d4c9fb;
  border-radius: 15px;
  color: #4b3a80;
  background: #f5f2ff;
  font-size: .88rem;
}
.suggestions > div { display: flex; flex-wrap: wrap; gap: 7px; }
.suggestions button { border-color: #c4b4f5; color: #573fa7; background: #fff; }

.result-filters {
  margin: 0 0 28px;
  border: 1px solid #dcd6ef;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(16,35,63,.04);
  overflow: hidden;
}
.filter-disclosure {
  min-height: 82px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.filter-disclosure::-webkit-details-marker { display: none; }
.filter-disclosure span:first-child { display: grid; gap: 2px; }
.filter-disclosure small { color: var(--primary); font-size: .75rem; }
.filter-disclosure strong { font-size: 1.08rem; }
.filter-disclosure-icon {
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 11px;
  background: #f1edff;
}
.filter-disclosure-icon::before,
.filter-disclosure-icon::after {
  content: "";
  position: absolute;
  top: 16px;
  left: 10px;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: var(--primary);
  transition: transform .2s;
}
.filter-disclosure-icon::after { transform: rotate(90deg); }
.result-filters[open] .filter-disclosure-icon::after { transform: rotate(0); }
.result-filters[open] .filter-disclosure { border-bottom: 1px solid var(--line); }
.filter-disclosure:focus-visible { outline: 3px solid rgba(118,88,237,.24); outline-offset: -4px; }
.filter-panel-body { padding: 22px; }
.filter-heading > p {
  margin: 0;
  color: var(--muted);
  font-size: .84rem;
}
.filter-heading {
  margin-bottom: 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.reset-filters {
  padding: 7px 12px;
  border: 1px solid #d2c9ef;
  border-radius: 10px;
  color: #5b3fd0;
  background: #f8f6ff;
  cursor: pointer;
}
.reset-filters:hover { border-color: var(--primary); background: #f1edff; }
.filter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.filter-field { display: grid; gap: 6px; color: var(--ink); font-size: .83rem; font-weight: 800; }
.filter-field small { color: var(--muted); font-size: .72rem; font-weight: 400; }
.filter-field input,
.filter-field select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #d5dbe4;
  border-radius: 11px;
  color: var(--ink);
  background: #fbfcfd;
  outline: none;
  font-family: "B Yekan", Tahoma, Arial, sans-serif;
}
.filter-field input:focus,
.filter-field select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(118,88,237,.13); }
.filter-footer {
  margin-top: 18px;
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
}
.filter-footer p { margin: 0; color: var(--muted); font-size: .84rem; }
.limited-toggle { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: .86rem; font-weight: 800; }
.limited-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.limited-toggle span {
  position: relative;
  width: 40px;
  height: 23px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #cfd5df;
  transition: background .2s;
}
.limited-toggle span::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(16,35,63,.18);
  transition: transform .2s;
}
.limited-toggle input:checked + span { background: var(--primary); }
.limited-toggle input:checked + span::after { transform: translateX(-17px); }
.limited-toggle input:focus-visible + span { outline: 3px solid rgba(118,88,237,.25); outline-offset: 2px; }
.filter-empty {
  margin-bottom: 24px;
  padding: 18px;
  border: 1px dashed #d5cbed;
  border-radius: 14px;
  color: var(--muted);
  background: #faf8ff;
  text-align: center;
}

.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.product-card {
  position: relative;
  min-height: 280px;
  padding: 20px;
  display: grid;
  grid-template-columns: 178px 1fr;
  gap: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(16,35,63,.055);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.product-card:hover { border-color: #c8bdf0; box-shadow: var(--shadow); transform: translateY(-2px); }
.product-rank {
  position: absolute;
  top: 13px;
  right: 13px;
  z-index: 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, #7658ed, #3f2e8b);
  font-size: .84rem;
  font-weight: 900;
  box-shadow: 0 5px 14px rgba(16,35,63,.22);
}
.product-image-wrap {
  position: relative;
  width: 100%;
  min-height: 210px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  color: inherit;
  background: #f3f6f9;
  cursor: zoom-in;
}
.product-image-wrap:disabled { cursor: default; }
.product-image-wrap:not(:disabled):focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.product-image-wrap:not(:disabled):hover .product-image { transform: scale(1.035); }
.product-image { position: relative; z-index: 1; width: 100%; height: 100%; max-height: 230px; object-fit: contain; }
.product-image { transition: transform .25s ease; }
.product-image.is-missing { display: none; }
.image-fallback {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, transparent 48%, rgba(118,88,237,.08) 49%, rgba(118,88,237,.08) 51%, transparent 52%),
    #f3f6f9;
}
.product-watermark {
  position: absolute;
  left: 9px;
  bottom: 9px;
  z-index: 3;
  padding: 3px 8px;
  border: 1px solid rgba(91,63,208,.18);
  border-radius: 7px;
  color: rgba(53,39,112,.72);
  background: rgba(255,255,255,.76);
  font-family: Arial, sans-serif;
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .02em;
  direction: ltr;
  pointer-events: none;
  user-select: none;
  backdrop-filter: blur(3px);
}
.image-zoom-hint {
  position: absolute;
  right: 9px;
  bottom: 9px;
  z-index: 3;
  padding: 4px 9px;
  border-radius: 999px;
  color: #fff;
  background: rgba(36,33,63,.78);
  font-size: .72rem;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}
.product-image-wrap:not(:disabled):hover .image-zoom-hint,
.product-image-wrap:not(:disabled):focus-visible .image-zoom-hint { opacity: 1; transform: translateY(0); }
.product-content { min-width: 0; display: flex; flex-direction: column; }
.product-meta { min-height: 27px; padding-left: 32px; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .75rem; }
.product-meta span:not(:empty) { padding: 3px 7px; border-radius: 7px; background: #f0f4f8; }
.product-meta .product-source:not(:empty) { color: #4f35bd; background: #eee9ff; font-weight: 800; }
.product-card[data-source="basalam"] .product-meta .product-source { color: #9d321e; background: #fff0eb; }
.product-title { margin: 10px 0 14px; display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 1rem; line-height: 1.75; }
.product-seller { margin: -5px 0 12px; color: var(--muted); font-size: .76rem; line-height: 1.7; }
.rating-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: .78rem; }
.raw-rating { color: #7b5a04; }
.raw-rating span { color: var(--accent); }
.weighted-rating { padding-right: 8px; border-right: 1px solid var(--line); }
.score-track { height: 5px; margin-top: 10px; overflow: hidden; border-radius: 999px; background: #edf1f5; }
.score-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #22c9c3); }
.product-bottom { margin-top: auto; padding-top: 18px; display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.product-price { margin: 0; white-space: nowrap; }
.product-price strong { display: block; font-size: 1.22rem; letter-spacing: -.03em; }
.product-price span { color: var(--muted); font-size: .74rem; }
.product-actions { display: flex; gap: 7px; }
.secondary-link { min-width: 68px; padding: 7px 11px; border: 1px solid #c9d3df; border-radius: 10px; color: var(--ink); background: #fff; text-align: center; text-decoration: none; font-size: .78rem; font-weight: 800; }
.secondary-link:hover { border-color: var(--primary); color: var(--primary); }
.secondary-link:focus-visible, .examples button:focus-visible, .suggestions button:focus-visible { outline: 3px solid rgba(118,88,237,.28); outline-offset: 2px; }

.pagination { margin-top: 32px; display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 7px; }
.pagination button { min-width: 42px; min-height: 42px; padding: 0 12px; border: 1px solid #cfd8e3; border-radius: 11px; color: var(--ink); background: #fff; cursor: pointer; }
.pagination button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pagination button[aria-current="page"] { border-color: var(--ink); color: #fff; background: var(--ink); }
.pagination button:disabled { opacity: .45; cursor: not-allowed; }

.limited-evidence {
  margin-top: 54px;
  padding-top: 36px;
  border-top: 1px solid var(--line);
}
.limited-evidence-header {
  margin-bottom: 22px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}
.limited-evidence-header .eyebrow { margin-bottom: 5px; color: #9a6700; }
.limited-evidence-header h3 { margin: 0; font-size: 1.45rem; }
.limited-evidence-header p:last-child { margin: 7px 0 0; color: var(--muted); }
.limited-evidence-badge {
  padding: 7px 12px;
  border: 1px solid #f2cf76;
  border-radius: 999px;
  color: #805500;
  background: #fff8dd;
  font-size: .78rem;
  white-space: nowrap;
}
.limited-evidence .product-card { border-color: #eadba9; background: #fffdf7; }
.limited-evidence .product-rank { background: linear-gradient(135deg, #d79a17, #9a6700); }

.source-results {
  margin-top: 56px;
  padding-top: 38px;
  border-top: 1px solid var(--line);
}
.source-results-header {
  margin-bottom: 22px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}
.source-results-header .eyebrow { margin-bottom: 5px; color: #bc452b; }
.source-results-header h3 { margin: 0; font-size: 1.55rem; }
.source-results-header p:last-child { margin: 7px 0 0; color: var(--muted); }
.source-results-badge {
  padding: 7px 12px;
  border: 1px solid #f2b49f;
  border-radius: 999px;
  color: #8f311e;
  background: #fff2ed;
  font-size: .78rem;
  white-space: nowrap;
}
.source-status {
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 1px solid #f1c7b9;
  border-radius: 13px;
  color: #7b3425;
  background: #fff7f4;
}
.basalam-results .product-card { border-color: #efd4ca; }
.basalam-results .product-rank { background: linear-gradient(135deg, #ff7657, #bd4429); }
.source-limited { margin-top: 38px; padding-top: 28px; border-top: 1px dashed #e5c7bc; }
.source-limited h4 { margin: 0; font-size: 1.15rem; }
.source-limited > p { margin: 7px 0 18px; color: var(--muted); }
.source-limited .product-card { background: #fffaf8; }

.back-to-top-wrap {
  margin-top: 38px;
  display: flex;
  justify-content: center;
}
.back-to-top {
  min-width: 190px;
  min-height: 48px;
  padding: 10px 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #8062f2, #6748dc);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(103,72,220,.24);
  transition: background .2s, box-shadow .2s, transform .2s;
}
.back-to-top span { font-size: 1.05rem; line-height: 1; }
.back-to-top:hover { background: linear-gradient(135deg, #7050e7, #5637c8); box-shadow: 0 10px 24px rgba(86,55,200,.3); transform: translateY(-1px); }
.back-to-top:focus-visible { outline: 3px solid #fde68a; outline-offset: 3px; }

.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  padding: 24px;
  display: grid;
  place-items: center;
}
.gallery-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgba(17,12,36,.86);
  cursor: default;
  backdrop-filter: blur(7px);
}
.gallery-dialog {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%);
  max-height: calc(100vh - 48px);
  padding: 20px;
  overflow: auto;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 24px;
  outline: none;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 30px 90px rgba(0,0,0,.38);
}
.gallery-header {
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.gallery-header small { display: block; color: var(--primary); font-size: .78rem; font-weight: 800; }
.gallery-header h2 { max-width: 780px; margin: 4px 0 0; font-size: clamp(1rem, 2vw, 1.35rem); line-height: 1.55; }
.gallery-close {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: var(--ink);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}
.gallery-stage {
  min-height: min(62vh, 620px);
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) 78px;
  align-items: center;
  gap: 14px;
  direction: ltr;
  touch-action: pan-y;
  user-select: none;
}
.gallery-figure {
  position: relative;
  grid-column: 2;
  height: min(62vh, 620px);
  min-height: 340px;
  margin: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 18px;
  background:
    linear-gradient(45deg, #f4f3f8 25%, transparent 25%, transparent 75%, #f4f3f8 75%),
    linear-gradient(45deg, #f4f3f8 25%, #fff 25%, #fff 75%, #f4f3f8 75%);
  background-position: 0 0, 10px 10px;
  background-size: 20px 20px;
}
.gallery-figure img {
  display: block;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}
.gallery-watermark {
  position: absolute;
  left: 14px;
  bottom: 14px;
  padding: 5px 10px;
  border: 1px solid rgba(91,63,208,.2);
  border-radius: 8px;
  color: rgba(53,39,112,.78);
  background: rgba(255,255,255,.82);
  font-family: Arial, sans-serif;
  font-size: .78rem;
  font-weight: 700;
  direction: ltr;
  backdrop-filter: blur(3px);
}
.gallery-nav {
  min-height: 48px;
  padding: 8px;
  border: 1px solid #d3c9f2;
  border-radius: 14px;
  color: var(--primary-dark);
  background: #f4f0ff;
  font-weight: 800;
  cursor: pointer;
  direction: rtl;
}
.gallery-previous { grid-column: 1; grid-row: 1; }
.gallery-next { grid-column: 3; grid-row: 1; }
.gallery-nav:hover { border-color: var(--primary); background: #ebe5ff; }
.gallery-nav:focus-visible, .gallery-close:focus-visible, .gallery-thumbnail:focus-visible { outline: 3px solid #f4c24b; outline-offset: 2px; }
.gallery-info { min-height: 31px; margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.gallery-info p { margin: 0; color: var(--muted); font-size: .82rem; }
.gallery-counter { color: var(--primary-dark); font-size: .82rem; font-weight: 800; white-space: nowrap; }
.gallery-thumbnails {
  margin-top: 10px;
  padding: 4px 2px 8px;
  display: flex;
  gap: 9px;
  overflow-x: auto;
  direction: ltr;
}
.gallery-thumbnail {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  padding: 3px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: #f4f6f9;
  cursor: pointer;
}
.gallery-thumbnail[aria-current="true"] { border-color: var(--primary); }
.gallery-thumbnail img { width: 100%; height: 100%; border-radius: 8px; object-fit: contain; }

footer { border-top: 1px solid var(--line); background: #fff; }
.footer-inner { padding-block: 30px; display: flex; justify-content: space-between; gap: 30px; color: var(--muted); font-size: .8rem; }
.footer-inner p { max-width: 520px; margin: 0; }
.footer-inner strong { color: var(--ink); }

[hidden] { display: none !important; }

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; padding-block: 56px 64px; }
  .hero-copy { text-align: center; }
  .hero-description { margin-inline: auto; }
  .product-grid { grid-template-columns: 1fr; }
  .product-card { grid-template-columns: 190px 1fr; }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .shell { width: min(100% - 28px, 1180px); }
  .header-inner { min-height: 68px; }
  .brand small { display: none; }
  .hero-grid { min-height: auto; padding-block: 45px 52px; gap: 34px; }
  h1 { font-size: clamp(2rem, 10vw, 3rem); }
  .search-panel { padding: 20px; border-radius: 19px; }
  .search-row { flex-direction: column; }
  .primary-button { width: 100%; }
  .trust-grid { padding-block: 16px; grid-template-columns: 1fr; }
  .trust-grid > div { padding: 14px 4px; border-left: 0; border-bottom: 1px solid var(--line); }
  .trust-grid > div:last-child { border-bottom: 0; }
  .results-shell.is-active { padding-block: 44px 65px; }
  .results-header { align-items: flex-start; flex-direction: column; }
  .filter-heading, .filter-footer { align-items: flex-start; flex-direction: column; }
  .limited-evidence-header { align-items: flex-start; flex-direction: column; }
  .source-results-header { align-items: flex-start; flex-direction: column; }
  .skeleton-grid { grid-template-columns: 1fr; }
  .product-card { padding: 17px; grid-template-columns: 130px 1fr; gap: 14px; }
  .product-image-wrap { min-height: 178px; }
  .product-bottom { align-items: flex-start; flex-direction: column; }
  .product-actions { width: 100%; }
  .secondary-link { flex: 1; }
  .footer-inner { flex-direction: column; gap: 12px; }
  .gallery-modal { padding: 0; }
  .gallery-dialog { width: 100%; max-height: 100vh; min-height: 100vh; padding: 16px; border: 0; border-radius: 0; }
  .gallery-stage { min-height: auto; grid-template-columns: 64px minmax(0, 1fr) 64px; gap: 8px; }
  .gallery-figure { height: min(58vh, 540px); min-height: 300px; }
  .gallery-nav { min-height: 44px; padding-inline: 4px; font-size: .78rem; }
}

@media (max-width: 470px) {
  .filter-disclosure { min-height: 72px; padding: 15px 17px; }
  .filter-panel-body { padding: 17px; }
  .filter-grid { grid-template-columns: 1fr; }
  .product-card { grid-template-columns: 1fr; }
  .product-image-wrap { min-height: 220px; }
  .product-meta { padding-left: 0; }
  .product-title { -webkit-line-clamp: 3; }
  .gallery-stage { position: relative; display: block; }
  .gallery-figure { height: 58vh; min-height: 280px; }
  .gallery-nav { position: absolute; top: 50%; z-index: 2; width: 58px; background: rgba(244,240,255,.92); transform: translateY(-50%); }
  .gallery-previous { left: 8px; }
  .gallery-next { right: 8px; }
  .gallery-info { align-items: flex-start; flex-direction: column; gap: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
