:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #05070d;
  color: #f8fafc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 78% 10%, rgba(14, 165, 233, 0.18), transparent 34rem),
    linear-gradient(180deg, #05070d 0%, #101827 50%, #05070d 100%);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(5, 7, 13, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 28px rgba(14, 165, 233, 0.25);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
  text-transform: uppercase;
}

.brand small,
.hero p,
.product-card p,
.category-button p {
  color: #cbd5e1;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.back-link,
.cart-link,
.buy-button,
.share-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 6px;
  padding: 10px 16px;
  font-weight: 800;
  background: #0ea5e9;
  color: #fff;
  box-shadow: 0 0 28px rgba(14, 165, 233, 0.28);
}

.cart-link {
  gap: 8px;
  border: 1px solid rgba(132, 204, 22, 0.28);
  background: rgba(132, 204, 22, 0.14);
  box-shadow: none;
}

.cart-link span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #84cc16;
  color: #0f172a;
  font-size: 12px;
  font-weight: 900;
}

.secondary-button {
  border: 1px solid rgba(56, 189, 248, 0.28);
  background: rgba(14, 165, 233, 0.1);
  box-shadow: none;
}

.share-button {
  border: 1px solid rgba(125, 211, 252, 0.28);
  background: rgba(15, 23, 42, 0.78);
  color: #dbeafe;
  box-shadow: none;
  cursor: pointer;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 54px 0 72px;
}

.hero {
  max-width: 820px;
  margin-bottom: 32px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #38bdf8;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  font-size: clamp(36px, 7vw, 72px);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero p:last-child {
  max-width: 720px;
  font-size: 18px;
  line-height: 1.7;
}

.category-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.category-button,
.product-card {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.76);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
}

.category-button {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 76px;
  overflow: hidden;
  padding: 14px;
  color: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.category-button:hover,
.category-button.active {
  border-color: rgba(56, 189, 248, 0.75);
  background: rgba(14, 165, 233, 0.13);
  transform: translateY(-2px);
}

.category-media {
  display: block;
  width: 46px;
  height: 46px;
  border-radius: 7px;
  object-fit: cover;
  background: rgba(14, 165, 233, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.18);
}

.category-body {
  display: block;
  min-width: 0;
}

.category-button strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
  line-height: 1.2;
}

.category-button p,
.product-card p {
  margin: 0;
  line-height: 1.55;
}

.catalog-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-top: 8px;
  scroll-margin-top: 18px;
}

.catalog-head h2 {
  font-size: clamp(26px, 4vw, 42px);
}

#productCount {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 10px 14px;
  color: #cbd5e1;
  background: rgba(0, 0, 0, 0.22);
  font-weight: 800;
}

.catalog-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 12px;
}

.sort-control {
  display: grid;
  gap: 6px;
  min-width: 210px;
}

.sort-control span {
  color: #38bdf8;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sort-control select {
  min-height: 42px;
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 6px;
  padding: 0 12px;
  color: #fff;
  background: rgba(15, 23, 42, 0.86);
  outline: none;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.sort-control select:focus {
  border-color: rgba(56, 189, 248, 0.75);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 360px));
  align-items: stretch;
  gap: 18px;
  justify-content: start;
}

.other-categories {
  margin-top: 46px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.other-categories-head {
  max-width: 680px;
}

.other-categories-head h2 {
  font-size: clamp(24px, 3vw, 34px);
}

.catalog-search {
  display: block;
  margin-top: 18px;
}

.catalog-search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.catalog-search input {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 8px;
  padding: 0 16px;
  color: #fff;
  background: rgba(15, 23, 42, 0.76);
  outline: none;
  font: inherit;
  font-weight: 700;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.2);
}

.catalog-search input:focus {
  border-color: rgba(56, 189, 248, 0.75);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.empty-category {
  grid-column: 1 / -1;
  max-width: 720px;
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 8px;
  padding: 28px;
  background: rgba(15, 23, 42, 0.76);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
}

.empty-category strong {
  display: block;
  color: #fff;
  font-size: 26px;
  font-weight: 950;
}

.empty-category p {
  margin: 12px 0 0;
  color: #cbd5e1;
  line-height: 1.7;
}

.empty-category .catalog-muted {
  color: #94a3b8;
  font-size: 13px;
}

.empty-category .buy-button {
  width: auto;
  margin-top: 20px;
}

.product-card-link {
  display: block;
  flex: 0 0 auto;
}

.catalog-product-highlight {
  animation: catalogProductFocus 2.8s ease-out 1;
}

@keyframes catalogProductFocus {
  0% {
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.72), 0 24px 80px rgba(14, 165, 233, 0.18);
  }
  100% {
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.34);
  }
}

@media (prefers-reduced-motion: reduce) {
  .catalog-product-highlight {
    animation: none;
  }
}

.product-media {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(rgba(56, 189, 248, 0.11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.11) 1px, transparent 1px),
    linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(255, 255, 255, 0.04));
  background-size: 24px 24px, 24px 24px, auto;
  color: #38bdf8;
  font-size: 38px;
}

.product-placeholder {
  gap: 6px;
  text-align: center;
}

.product-placeholder strong {
  display: block;
  font-size: 44px;
  line-height: 1;
}

.product-placeholder span {
  color: #bae6fd;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.product-gallery {
  padding: 14px;
  background:
    linear-gradient(rgba(125, 211, 252, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 211, 252, 0.13) 1px, transparent 1px),
    linear-gradient(135deg, rgba(14, 165, 233, 0.22), rgba(8, 47, 73, 0.92));
  background-size: 22px 22px, 22px 22px, auto;
}

.product-photo {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  object-fit: contain;
  background: rgba(224, 242, 254, 0.82);
}

.product-thumbs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.product-thumbs img {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 6px;
  object-fit: cover;
  background: #fff;
}

.product-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px;
}

.product-body small {
  color: #38bdf8;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.product-body h3 {
  margin-top: 8px;
  min-height: 58px;
  font-size: 22px;
  line-height: 1.3;
}

.product-body h3 a:hover {
  color: #7dd3fc;
}

.product-body > p {
  display: -webkit-box;
  min-height: 72px;
  margin-top: 12px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.product-footer {
  display: flex;
  flex-direction: column;
  margin-top: auto;
  padding-top: 18px;
}

.spec-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.spec-list li {
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 6px;
  padding: 7px 9px;
  color: #dbeafe;
  background: rgba(14, 165, 233, 0.08);
  font-size: 12px;
  font-weight: 800;
}

.price {
  margin: 16px 0 4px;
  color: #fff;
  font-size: 28px;
  font-weight: 950;
}

.price-featured {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  color: #fff;
}

.price-featured strong {
  font-size: 30px;
}

.price-featured span {
  color: #7dd3fc;
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}

.terms {
  color: #38bdf8;
  font-size: 14px;
  font-weight: 800;
}

.stock-badge {
  display: inline-flex;
  width: fit-content;
  margin-top: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.stock-in {
  border-color: rgba(34, 197, 94, 0.35);
  color: #bbf7d0;
  background: rgba(22, 163, 74, 0.12);
}

.stock-low {
  border-color: rgba(250, 204, 21, 0.38);
  color: #fef08a;
  background: rgba(202, 138, 4, 0.12);
}

.stock-order {
  border-color: rgba(56, 189, 248, 0.38);
  color: #bae6fd;
  background: rgba(14, 165, 233, 0.12);
}

.stock-out {
  border-color: rgba(248, 113, 113, 0.38);
  color: #fecaca;
  background: rgba(220, 38, 38, 0.12);
}

.buy-button {
  width: 100%;
}

.product-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.product-actions .buy-button,
.product-actions .secondary-button {
  width: 100%;
  margin-top: 0;
}

.product-actions .buy-button,
.product-actions .secondary-button {
  min-height: 44px;
}

.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 24px;
  grid-column: 1 / -1;
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.76);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.detail-gallery {
  padding: 18px;
  background:
    linear-gradient(rgba(125, 211, 252, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 211, 252, 0.13) 1px, transparent 1px),
    linear-gradient(135deg, rgba(14, 165, 233, 0.22), rgba(8, 47, 73, 0.92));
  background-size: 22px 22px, 22px 22px, auto;
}

.detail-photo-frame {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: rgba(224, 242, 254, 0.82);
  cursor: zoom-in;
  overflow: hidden;
}

.detail-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 260ms ease;
  transform-origin: center;
}

@media (hover: hover) and (pointer: fine) {
  .detail-photo-frame:hover .detail-photo {
    transform: scale(1.12);
  }
}

.detail-photo-placeholder {
  min-height: 320px;
  border: 1px solid rgba(125, 211, 252, 0.24);
  color: #38bdf8;
  background:
    linear-gradient(rgba(125, 211, 252, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 211, 252, 0.13) 1px, transparent 1px),
    linear-gradient(135deg, rgba(8, 47, 73, 0.94), rgba(15, 23, 42, 0.96));
  background-size: 22px 22px, 22px 22px, auto;
  cursor: default;
  text-align: center;
}

.detail-photo-placeholder strong,
.detail-photo-placeholder span {
  display: block;
}

.detail-photo-placeholder strong {
  font-size: clamp(58px, 8vw, 92px);
  line-height: 1;
}

.detail-photo-placeholder span {
  margin-top: 10px;
  color: #bae6fd;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.detail-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, 76px);
  gap: 10px;
  justify-content: start;
  margin-top: 12px;
}

.detail-thumbs button {
  width: 76px;
  height: 76px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
}

.detail-thumbs button.active,
.detail-thumbs button:hover {
  border-color: #0ea5e9;
}

.detail-thumbs img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 6, 23, 0.92);
  backdrop-filter: blur(10px);
}

.image-viewer img {
  display: block;
  max-width: min(1120px, 100%);
  max-height: 82vh;
  border-radius: 8px;
  object-fit: contain;
  background: rgba(224, 242, 254, 0.92);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
}

.image-viewer-close {
  position: fixed;
  top: 16px;
  right: 16px;
  min-height: 42px;
  border: 1px solid rgba(125, 211, 252, 0.35);
  border-radius: 6px;
  padding: 9px 14px;
  background: rgba(15, 23, 42, 0.88);
  color: #e0f2fe;
  font-weight: 900;
  cursor: pointer;
}

body.viewer-open {
  overflow: hidden;
}

.detail-body {
  padding: 28px 24px 28px 0;
}

.detail-body small {
  color: #38bdf8;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.detail-body h3 {
  margin-top: 10px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
}

.detail-body p {
  color: #cbd5e1;
  line-height: 1.7;
}

.variant-selector {
  display: grid;
  gap: 10px;
  margin: 18px 0 2px;
  padding: 14px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 8px;
  background: rgba(14, 165, 233, 0.08);
}

.variant-selector span {
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 800;
}

.variant-selector strong {
  color: #fff;
}

.variant-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.variant-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid rgba(125, 211, 252, 0.28);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.72);
  color: #dbeafe;
  font-weight: 900;
  cursor: pointer;
}

.variant-button.active,
.variant-button:hover {
  border-color: #38bdf8;
  background: rgba(14, 165, 233, 0.18);
  color: #fff;
}

.variant-button small {
  border-radius: 999px;
  padding: 2px 6px;
  color: #fecaca;
  background: rgba(220, 38, 38, 0.18);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.variant-swatch {
  width: 16px;
  height: 16px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.85);
}

.detail-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.detail-actions .buy-button,
.detail-actions .share-button,
.detail-actions .secondary-button {
  width: 100%;
  margin: 0;
}

@media (max-width: 960px) {
  .category-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .back-link {
    width: 100%;
  }

  .cart-link {
    width: 100%;
  }

  .hero {
    margin-bottom: 18px;
  }

  .hero p:last-child {
    font-size: 15px;
  }

  .category-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    margin: 12px 0 0;
    padding: 0;
  }

  .category-button {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 8px;
    min-height: 66px;
    padding: 10px;
  }

  .category-button:hover,
  .category-button.active {
    transform: none;
  }

  .category-media {
    width: 34px;
    height: 34px;
  }

  .category-body {
    padding: 0;
  }

  .category-button strong {
    margin-bottom: 0;
    font-size: 13px;
    line-height: 1.2;
  }

  .category-button p {
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.2;
  }

  .catalog-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
    scroll-margin-top: 14px;
  }

  .catalog-head h2 {
    font-size: 28px;
  }

  #productCount {
    padding: 8px 12px;
  }

  .catalog-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .sort-control {
    min-width: 0;
    width: 100%;
  }

  .other-categories {
    margin-top: 32px;
    padding-top: 22px;
  }

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

  .product-body h3,
  .product-body > p {
    min-height: 0;
  }

  .detail-body {
    padding: 0 18px 22px;
  }

  .detail-photo-frame {
    cursor: zoom-in;
  }

  .detail-thumbs {
    grid-template-columns: repeat(auto-fill, 64px);
  }

  .detail-thumbs button {
    width: 64px;
    height: 64px;
  }

  .image-viewer {
    padding: 14px;
  }

  .image-viewer img {
    max-height: 78vh;
  }
}
