:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --panel-soft: #f1f5f9;
  --text: #0f172a;
  --subtext: #475569;
  --line: #dbe3ef;
  --brand: #bdddf5;
  --brand-strong: #8ab9e0;
  --brand-ink: #1a4a6e;
  --instock-bg: #dcfce7;
  --instock-text: #166534;
  --preorder-bg: #fef3c7;
  --preorder-text: #92400e;
  --soldout-bg: #fee2e2;
  --soldout-text: #991b1b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

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

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.narrow {
  width: min(760px, 100%);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

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

.logo {
  font-weight: 800;
  letter-spacing: 0.01em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.95rem;
}

.nav a {
  color: var(--subtext);
  font-weight: 500;
}

.nav a.active {
  color: var(--text);
}

.nav a:hover {
  color: var(--text);
}

.hero {
  padding: 3.4rem 0;
}

.hero-soft {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 1.2rem;
  align-items: start;
}

.hero h1,
.page-hero h1 {
  margin: 0;
  font-size: clamp(1.9rem, 3.8vw, 2.8rem);
  line-height: 1.18;
}

h2 {
  margin: 0;
  font-size: clamp(1.25rem, 2.6vw, 1.75rem);
}

h3 {
  margin: 0;
  font-size: 1.05rem;
}

.pill {
  margin: 0 0 0.8rem;
  display: inline-flex;
  border: 1px solid #a8cce8;
  background: #e8f4fc;
  color: var(--brand-ink);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.82rem;
}

.hero-copy,
.section-copy {
  margin: 0.7rem 0 0;
  color: var(--subtext);
  line-height: 1.6;
}

.hero-actions {
  margin-top: 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.section {
  padding: 2.4rem 0;
}

.section-search {
  padding: 1.25rem 0;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.home-search {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: flex-end;
}

.home-search input[type="search"] {
  flex: 1;
  min-width: min(100%, 220px);
  margin-top: 0;
}

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

.section-soft {
  background: var(--panel-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.page-hero {
  padding: 2.5rem 0 1.2rem;
}

.section-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.card-image-link {
  display: block;
  outline: none;
}

.card-image-link:focus-visible {
  box-shadow: inset 0 0 0 3px rgba(26, 74, 110, 0.35);
}

.card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #e2e8f0;
}

.page-hero-tight {
  padding-top: 1.5rem;
}

.product-back {
  display: inline-block;
  margin-bottom: 1rem;
}

.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 1.5rem;
  align-items: start;
  margin-top: 0.5rem;
}

.product-detail-media {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
}

.product-detail-media img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #e2e8f0;
}

.product-detail-body {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.product-detail-body > .card-title {
  font-size: 1.25rem;
}

.product-detail-block-title {
  margin: 0.25rem 0 0.35rem;
  font-size: 1rem;
}

.product-detail-desc {
  margin: 0;
  color: var(--subtext);
  line-height: 1.65;
  font-size: 0.95rem;
}

.product-detail-ship {
  margin: 0;
  padding: 0.85rem 0.95rem;
  border-radius: 10px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--subtext);
  line-height: 1.55;
}

.product-detail-ship h3 {
  margin: 0 0 0.45rem;
  font-size: 0.98rem;
  color: var(--text);
}

.product-detail-ship ul {
  margin: 0;
  padding-left: 1.1rem;
}

.product-detail-order {
  margin-top: 0.35rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 0.48rem;
  padding: 0.85rem;
}

.card-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
}

.meta {
  margin: 0;
  color: var(--subtext);
  font-size: 0.9rem;
}

.small {
  margin: 0;
  color: var(--subtext);
  font-size: 0.82rem;
}

.price {
  margin: 0.1rem 0;
  font-size: 1.1rem;
  font-weight: 800;
}

.status {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 0.2rem 0.58rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.status.instock {
  background: var(--instock-bg);
  color: var(--instock-text);
}

.status.preorder {
  background: var(--preorder-bg);
  color: var(--preorder-text);
}

.status.soldout {
  background: var(--soldout-bg);
  color: var(--soldout-text);
}

.controls {
  display: grid;
  grid-template-columns: 1fr 90px;
  gap: 0.45rem;
}

.controls--qty-only {
  grid-template-columns: 1fr;
  max-width: 11rem;
}

.qty-field {
  display: block;
}

.qty-field-label {
  display: block;
  font-size: 0.9rem;
  color: var(--subtext);
  margin-bottom: 0.25rem;
}

.variant-fieldset {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.85rem 0.75rem;
  margin-bottom: 0.55rem;
  background: #fafbfc;
}

.variant-legend {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  padding: 0 0.2rem;
}

.variant-hint {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.82rem;
  color: var(--subtext);
  line-height: 1.35;
}

.variant-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.variant-qty-row {
  display: grid;
  grid-template-columns: 1fr 6.2rem;
  align-items: center;
  gap: 0.55rem;
}

.variant-qty-name {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.3;
}

.variant-qty-field {
  display: block;
}

.variant-qty-field-label {
  display: none;
}

.variant-qty-input {
  margin-top: 0;
  min-height: 36px;
  padding: 0.3rem 0.45rem;
  text-align: center;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: flex-end;
}

.filters .search-field {
  flex: 1;
  min-width: min(100%, 200px);
}

label {
  color: var(--subtext);
  font-size: 0.9rem;
}

select,
input {
  margin-top: 0.3rem;
  display: block;
  width: 100%;
  min-height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  background: #fff;
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.46rem 0.92rem;
  border: 1px solid var(--brand-strong);
  border-radius: 10px;
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 700;
  cursor: pointer;
}

.btn:hover {
  background: var(--brand-strong);
  border-color: #6fa3d4;
  color: var(--brand-ink);
}

.btn:focus-visible {
  outline: 2px solid var(--brand-ink);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-small {
  min-height: 34px;
  font-size: 0.87rem;
  padding: 0.2rem 0.65rem;
}

.btn-ghost {
  border-color: var(--line);
  background: #fff;
  color: var(--text);
}

.block {
  width: 100%;
}

.text-link {
  color: var(--brand-ink);
  font-weight: 600;
}

.text-link:hover {
  text-decoration: underline;
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.info-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 1rem;
}

.info-card p {
  margin: 0.55rem 0 0;
  color: var(--subtext);
  line-height: 1.6;
}

.info-card-large h2 {
  font-size: 1.1rem;
}

.list {
  margin: 0.6rem 0 0;
  padding-left: 1rem;
  color: var(--subtext);
  line-height: 1.6;
}

.ordered {
  list-style: decimal;
}

details {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.8rem;
}

summary {
  cursor: pointer;
  font-weight: 700;
}

details p {
  margin: 0.6rem 0 0;
  color: var(--subtext);
}

.empty {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 1rem;
  color: var(--subtext);
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 1rem 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.footer-inner p {
  margin: 0.2rem 0 0;
  color: var(--subtext);
}

@media (max-width: 980px) {
  .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .nav a:not(.btn) {
    display: none;
  }

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

  .hero-grid,
  .split {
    grid-template-columns: 1fr;
  }

  .section-top {
    align-items: flex-start;
    flex-direction: column;
  }

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

@media (max-width: 520px) {
  .cards {
    grid-template-columns: 1fr;
  }
}
