:root {
  --ink: #121820;
  --ink-soft: #273140;
  --muted: #657184;
  --line: #dfe5ec;
  --line-strong: #ccd5e0;
  --paper: #ffffff;
  --canvas: #f4f6f9;
  --surface: #f8fafc;
  --accent: #1769e8;
  --accent-dark: #0f54bc;
  --accent-soft: #eaf2ff;
  --success: #187a43;
  --success-soft: #eaf7ef;
  --warning: #9a5b00;
  --warning-soft: #fff5dc;
  --danger: #b42318;
  --shadow-sm: 0 5px 16px rgba(26, 39, 60, 0.06);
  --shadow-md: 0 14px 34px rgba(26, 39, 60, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Noto Sans KR", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
}

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

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(23, 105, 232, 0.22);
  outline-offset: 2px;
}

svg {
  display: block;
  width: 1em;
  height: 1em;
  stroke-width: 1.8;
}

[hidden] {
  display: none !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(204, 213, 224, 0.82);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: grid;
  grid-template-columns: 260px 1fr 260px;
  align-items: center;
  width: min(100% - 36px, 1280px);
  min-height: 68px;
  margin: 0 auto;
  gap: 22px;
}

.brand {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid #b9d3fb;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.58);
  font-size: 23px;
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-copy strong {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.2;
}

.brand-copy small {
  color: #7b8797;
  font-size: 8px;
  font-weight: 700;
}

.top-nav {
  display: flex;
  height: 68px;
  align-items: stretch;
  justify-content: center;
  gap: 38px;
}

.top-nav a {
  position: relative;
  display: grid;
  min-width: 42px;
  place-items: center;
  color: #475366;
  font-size: 14px;
  font-weight: 700;
}

.top-nav a::after {
  position: absolute;
  right: 7px;
  bottom: -1px;
  left: 7px;
  height: 2px;
  background: transparent;
  content: "";
}

.top-nav a:hover,
.top-nav a.active {
  color: var(--ink);
}

.top-nav a.active::after {
  background: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.icon-button {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 20px;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.icon-button:hover {
  border-color: var(--line);
  background: var(--surface);
  color: var(--accent);
}

.icon-button.small {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  font-size: 17px;
}

.icon-badge {
  position: absolute;
  top: 2px;
  right: 1px;
  display: grid;
  min-width: 16px;
  height: 16px;
  place-items: center;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 8px;
  font-weight: 800;
}

.session-dot {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: #a9b2bf;
}

.account-button.logged-in .session-dot {
  background: #25a55f;
}

.search-control {
  position: relative;
  display: flex;
  align-items: center;
}

.search-control input {
  position: absolute;
  right: 0;
  width: 0;
  height: 38px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--paper);
  opacity: 0;
  pointer-events: none;
  transition: width 180ms ease, padding 180ms ease, opacity 160ms ease;
}

.search-control.open input,
.search-control:focus-within input {
  width: 190px;
  padding: 0 42px 0 12px;
  border-color: var(--line-strong);
  opacity: 1;
  pointer-events: auto;
}

.search-control .icon-button {
  z-index: 1;
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  width: min(100% - 36px, 1280px);
  margin: 0 auto;
  padding: 16px 0 26px;
  gap: 14px;
}

.main-column,
.side-column {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 14px;
}

.hero-card {
  position: relative;
  min-height: 338px;
  overflow: hidden;
  border: 1px solid #29313b;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(5, 10, 16, 0.9) 0%, rgba(5, 10, 16, 0.68) 43%, rgba(5, 10, 16, 0.08) 78%),
    url("../assets/developer-workspace-hero.png") center / cover;
  box-shadow: var(--shadow-md);
}

.hero-card::after {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: inherit;
  content: "";
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: grid;
  max-width: 510px;
  min-height: 338px;
  align-content: center;
  padding: 42px 48px;
  color: #fff;
}

.hero-kicker,
.section-label {
  color: #7d9fd5;
  font-size: 10px;
  font-weight: 800;
}

.hero-kicker {
  margin-bottom: 12px;
  color: #92bfff;
}

.hero-copy h1 {
  margin: 0;
  font-size: 42px;
  font-weight: 800;
  line-height: 1.19;
}

.hero-copy p {
  max-width: 420px;
  margin: 15px 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 15px;
  font-weight: 500;
}

.hero-link {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 7px;
  margin-top: 22px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.hero-link svg {
  font-size: 14px;
}

.catalog-section,
.account-card,
.order-summary,
.service-notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.catalog-section {
  padding: 18px 16px 16px;
}

.catalog-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 0 2px;
}

.catalog-head h2,
.order-summary h2 {
  margin: 2px 0 0;
  font-size: 18px;
  font-weight: 800;
}

.catalog-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.catalog-head p strong {
  color: var(--ink);
}

.catalog-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
}

.category-tabs {
  display: flex;
  min-width: 0;
  flex: 1;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.category-tabs button {
  min-height: 34px;
  flex: 0 0 auto;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.category-tabs button:hover {
  border-color: #aab7ca;
  color: var(--ink);
}

.category-tabs button.active {
  border-color: var(--accent);
  background: #eef3ff;
  color: var(--accent-dark);
}

.product-sort-control {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.product-sort-control select {
  min-width: 124px;
  height: 34px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.link-button,
.text-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.link-button svg {
  font-size: 14px;
}

.link-button:hover,
.text-button:hover {
  color: var(--accent-dark);
}

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

.product-card {
  display: grid;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.product-card:hover {
  border-color: #bfc9d7;
  box-shadow: 0 12px 24px rgba(26, 39, 60, 0.1);
  transform: translateY(-2px);
}

.product-media {
  position: relative;
  display: grid;
  min-height: 145px;
  aspect-ratio: 16 / 9;
  place-items: center;
  overflow: hidden;
  background: #ffffff;
}


.product-card[data-product-id="1"] {
  --image-y: -48px;
}

.product-card[data-product-id="2"] {
  --image-y: 0px;
  --image-height: 88%;
}

.product-card[data-product-id="3"] {
  --image-y: 24px;
  --image-height: 70%;
}

.product-card[data-product-id="4"] {
  --image-y: 0px;
  --image-height: 60%;
}

.product-card[data-product-id="5"] {
  --image-y: 4px;
  --image-height: 60%;
}

.product-card[data-product-id="6"] {
  --image-y: -30px;
}



.product-media {
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.product-media:focus-visible,
.product-title-button:focus-visible {
  outline: 3px solid rgba(23, 99, 224, 0.24);
  outline-offset: -3px;
}

.product-title-button {
  display: block;
  width: 100%;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.product-title-button:hover {
  color: var(--accent);
}

.product-media img {
  width: var(--image-width, 100%);
  height: var(--image-height, 88%);
  align-self: start;
  padding: 4px 14px 0;
  background: #ffffff;
  object-fit: contain;
  object-position: var(--image-object-position, center top);
  transform: translate(var(--image-x, 0px),
      var(--image-y, -14px));
  opacity: 1;
  transition:
    transform 240ms ease,
    opacity 160ms ease;
}

.product-card[data-product-id="7"] {
  --image-width: 75%;
  --image-height: 75%;
  --image-x: -4px;
  --image-y: 16px;
}

.product-card[data-product-id="8"] {
  --image-width: 90%;
  --image-height: 90%;
  --image-x: -4px;
  --image-y: -8px;
}

.product-card[data-product-id="9"] {
  --image-width: 80%;
  --image-height: 80%;
  --image-x: -4px;
  --image-y: 0px;
}

.product-card[data-product-id="10"] {
  --image-width: 85%;
  --image-height: 85%;
  --image-x: -4px;
  --image-y: -10px;
}

.product-card[data-product-id="11"] {
  --image-width: 95%;
  --image-height: 95%;
  --image-x: -12px;
  --image-y: -28px;
}

.product-card[data-product-id="12"] {
  --image-width: 100%;
  --image-height: 100%;
  --image-x: -4px;
  --image-y: -44px;
}

.product-card[data-product-id="13"] {
  --image-width: 85%;
  --image-height: 85%;
  --image-x: -4px;
  --image-y: -20px;
}

.product-card[data-product-id="14"] {
  --image-width: 75%;
  --image-height: 75%;
  --image-x: -4px;
  --image-y: 4px;
}

.product-card[data-product-id="15"] {
  --image-width: 80%;
  --image-height: 80%;
  --image-x: -4px;
  --image-y: -4px;
}

.product-card[data-product-id="16"] {
  --image-width: 85%;
  --image-height: 85%;
  --image-x: -16px;
  --image-y: 32px;
}

.product-card[data-product-id="17"] {
  --image-width: 90%;
  --image-height: 90%;
  --image-x: -4px;
  --image-y: -44px;
}

.product-card[data-product-id="19"] {
  --image-width: 80%;
  --image-height: 80%;
  --image-x: -4px;
  --image-y: 4px;
}

.product-card[data-product-id="20"] {
  --image-width: 80%;
  --image-height: 80%;
  --image-x: -4px;
  --image-y: -4px;
}

.product-media img.is-switching {
  opacity: 0;
}

.product-media-dots {
  position: absolute;
  right: 10px;
  bottom: 9px;
  display: flex;
  gap: 5px;
  padding: 5px 7px;
  border: 1px solid rgba(118, 132, 153, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 3px 10px rgba(25, 37, 56, 0.08);
  pointer-events: none;
}

.product-media-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #aeb8c7;
  transition:
    width 160ms ease,
    border-radius 160ms ease,
    background-color 160ms ease;
}

.product-media-dot.active {
  width: 13px;
  border-radius: 999px;
  background: var(--accent);
}

.product-card:hover .product-media img {
  transform:
    translate(var(--image-x, 0px),
      calc(var(--image-y, -14px) - 2px)) scale(1.01);
}

@media (prefers-reduced-motion: reduce) {

  .product-media img,
  .product-media-dot {
    transition: none;
  }
}


.image-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 145px;
  place-items: center;
  color: #8490a1;
  text-align: center;
}

.image-fallback span {
  display: grid;
  place-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 700;
}

.image-fallback svg {
  color: #6f7c8f;
  font-size: 36px;
  stroke-width: 1.4;
}

.product-body {
  display: grid;
  padding: 13px;
}

.product-category-label {
  display: block;
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
}

.product-topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}

.product-topline h3 {
  overflow: hidden;
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-badge {
  padding: 3px 7px;
  border: 1px solid #bfe3ca;
  border-radius: 6px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.stock-badge.low {
  border-color: #f0d59c;
  background: var(--warning-soft);
  color: var(--warning);
}

.product-desc {
  min-height: 36px;
  margin: 6px 0 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.price-row {
  display: flex;
  min-height: 26px;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.price {
  font-size: 16px;
  font-weight: 800;
}

.product-id {
  color: #8792a3;
  font-size: 9px;
  font-weight: 700;
}

.buy-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px;
}

.quantity-stepper {
  display: grid;
  grid-template-columns: 27px 1fr 27px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
}

.quantity-stepper button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
}

.quantity-stepper button:hover {
  background: var(--surface);
  color: var(--ink);
}

.quantity-stepper input {
  width: 100%;
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 0;
  text-align: center;
  appearance: textfield;
}

.quantity-stepper input::-webkit-inner-spin-button,
.quantity-stepper input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.button:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

.button:active {
  transform: translateY(1px);
}

.button.logout {
  border-color: #cfd7e2;
  background: var(--paper);
  color: var(--ink-soft);
}

.button.logout:hover {
  border-color: #aeb9c8;
  background: var(--surface);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.account-card,
.order-summary {
  padding: 17px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: -4px 0 16px;
  border-bottom: 1px solid var(--line);
}

.auth-tabs.single {
  grid-template-columns: 1fr;
}

.auth-tab {
  min-height: 40px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.auth-tab.active {
  border-color: var(--accent);
  color: var(--accent);
}

.auth-form {
  display: none;
  gap: 8px;
}

.auth-form.active {
  display: grid;
}

.login-fields {
  display: grid;
  gap: 8px;
}

label {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
}

input::placeholder {
  color: #98a2b2;
}

input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(23, 105, 232, 0.12);
}

.input-wrap {
  position: relative;
}

.input-wrap>svg {
  position: absolute;
  top: 50%;
  left: 11px;
  z-index: 1;
  color: #8b96a7;
  font-size: 15px;
  pointer-events: none;
  transform: translateY(-50%);
}

.input-wrap input {
  padding-left: 35px;
}

.input-wrap input[type="password"] {
  padding-right: 38px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #7c8797;
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle:hover {
  background: var(--surface);
  color: var(--ink);
}

.login-options,
.helper-text {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.check-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 500;
}

.check-label input {
  width: 14px;
  min-height: 14px;
  margin: 0;
  accent-color: var(--accent);
}

.muted-link {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.auth-action {
  width: 100%;
  margin-top: 3px;
}

.auth-action svg {
  font-size: 15px;
}

.helper-text {
  justify-content: center;
  margin: 4px 0 0;
}

.result-message {
  min-height: 18px;
  margin: 1px 0 0;
  font-size: 10px;
  font-weight: 700;
}

.signed-in-summary {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  margin-bottom: 4px;
  padding: 12px;
  border: 1px solid #cfe0f9;
  border-radius: 7px;
  background: #f3f7fd;
}

.user-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border-radius: 7px;
  background: var(--paper);
  color: var(--accent);
  font-size: 19px;
  box-shadow: 0 2px 8px rgba(23, 105, 232, 0.12);
}

.signed-in-summary div {
  display: grid;
  min-width: 0;
}

.signed-in-summary small {
  color: var(--muted);
  font-size: 9px;
}

.signed-in-summary strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 3px 0 2px;
}

.account-meta>div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.account-meta dt {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.account-meta dd {
  overflow: hidden;
  margin: 0;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.order-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.order-stats>div {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  grid-template-rows: auto auto;
  min-width: 0;
  align-items: center;
  gap: 0 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
}

.order-stat-icon {
  display: grid;
  grid-row: 1 / 3;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
}

.order-stat-icon.progress {
  background: var(--warning-soft);
  color: var(--warning);
}

.order-stat-icon.completed {
  background: var(--success-soft);
  color: var(--success);
}

.order-stats small {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-stats strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.2;
}

.order-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  margin-top: 10px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.product-card:last-child {
  grid-column: auto;
}

.order-filters button {
  display: inline-flex;
  min-width: 0;
  min-height: 29px;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0 5px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.order-filters button:hover:not(:disabled) {
  color: var(--ink-soft);
}

.order-filters button.active {
  background: var(--paper);
  color: var(--accent);
  box-shadow: 0 2px 7px rgba(26, 39, 60, 0.08);
}

.order-filters button:disabled {
  cursor: default;
  opacity: 0.52;
}

.order-filters span {
  color: inherit;
  font-size: 8px;
}

.order-list {
  display: grid;
  max-height: 540px;
  gap: 8px;
  margin-top: 10px;
  padding-right: 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.order-card {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.order-card:hover {
  border-color: #c8d5e5;
  box-shadow: var(--shadow-sm);
}

.order-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.order-card-head>div {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.order-card-head strong {
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
}

.order-card-head time {
  color: #8792a2;
  font-size: 8px;
}

.order-status-badge {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid #c8daf5;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 8px;
  font-weight: 800;
}

.order-status-badge.preparing,
.order-status-badge.paid {
  border-color: #edd8a8;
  background: var(--warning-soft);
  color: var(--warning);
}

.order-status-badge.shipped {
  border-color: #bdd7fb;
  background: #edf5ff;
  color: #1559ad;
}

.order-status-badge.completed {
  border-color: #bfe1ca;
  background: var(--success-soft);
  color: var(--success);
}

.order-status-badge.cancelled {
  border-color: #efc5c0;
  background: #fff1ef;
  color: var(--danger);
}

.order-card-body {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
}

.order-product-thumb {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: #8b96a7;
  font-size: 18px;
}

.order-product-thumb img {
  width: 100%;
  height: 100%;
  padding: 3px;
  object-fit: contain;
}

.order-card-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.order-card-copy strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-card-copy span {
  color: var(--muted);
  font-size: 8px;
}

.order-total-price {
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.order-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.order-progress li {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
  color: #9aa4b2;
}

.order-progress li:not(:first-child)::before {
  position: absolute;
  top: 4px;
  right: 50%;
  z-index: 0;
  width: 100%;
  height: 2px;
  background: #dfe5ec;
  content: "";
}

.order-progress li.done:not(:first-child)::before {
  background: #75a8f4;
}

.order-progress li>span {
  position: relative;
  z-index: 1;
  width: 10px;
  height: 10px;
  border: 2px solid #cdd5df;
  border-radius: 50%;
  background: var(--paper);
}

.order-progress li.done>span {
  border-color: var(--accent);
  background: var(--accent);
}

.order-progress li.current>span {
  box-shadow: 0 0 0 3px rgba(23, 105, 232, 0.13);
}

.order-progress li.done small {
  color: var(--ink-soft);
  font-weight: 700;
}

.order-progress small {
  font-size: 8px;
}

.order-cancel-note {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  color: var(--danger);
  font-size: 9px;
  font-weight: 700;
}

.order-cancel-note svg {
  font-size: 13px;
}

.empty-state {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  padding: 11px;
}

.order-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
}

.order-card p {
  margin: 2px 0;
  color: var(--muted);
  font-size: 10px;
}

.empty-state {
  grid-column: 1 / -1;
  display: flex;
  min-height: 100px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.empty-state.compact {
  min-height: 54px;
  font-size: 10px;
}

.empty-state.compact svg {
  flex: 0 0 auto;
  font-size: 16px;
}

.loading-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid #d6deea;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

body.product-detail-open {
  overflow: hidden;
}

.product-detail-dialog {
  width: min(880px, calc(100% - 32px));
  max-width: none;
  max-height: min(720px, calc(100svh - 40px));
  padding: 0;
  overflow: hidden;
  border: 1px solid #cfd8e5;
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 28px 70px rgba(18, 31, 50, 0.28);
}

.product-detail-dialog::backdrop {
  background: rgba(20, 30, 45, 0.62);
  backdrop-filter: blur(3px);
}

.product-detail-shell {
  position: relative;
  max-height: min(720px, calc(100svh - 40px));
  overflow: auto;
}

.product-detail-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  border-color: rgba(199, 208, 220, 0.82);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 18px rgba(20, 33, 51, 0.12);
}

.product-detail-state {
  display: grid;
  min-height: 390px;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 48px;
  color: var(--muted);
  text-align: center;
}

.product-detail-state.error {
  color: var(--danger);
}

.product-detail-state svg {
  width: 28px;
  height: 28px;
}

.product-detail-content {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  min-height: 500px;
}

.product-detail-content[hidden] {
  display: none;
}

.product-detail-media {
  display: flex;
  flex-direction: column;
  min-height: 500px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: #f7f8fa;
}

.product-detail-main-image {
  display: grid;
  flex: 1;
  width: 100%;
  min-height: 0;
  place-items: center;
  overflow: hidden;
}

.product-detail-main-image>img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 420px;
  padding: 36px;
  object-fit: contain;
  object-position: center;
}

.product-detail-main-image .image-fallback {
  min-height: 390px;
}

.product-detail-thumbnails {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  width: 100%;
  padding: 12px 16px 16px;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  scrollbar-width: thin;
}

.product-detail-thumbnail {
  flex: 0 0 72px;
  width: 72px;
  height: 58px;
  padding: 4px;
  overflow: hidden;
  border: 1px solid #cfd8e5;
  border-radius: 6px;
  background: var(--paper);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.product-detail-thumbnail:hover {
  border-color: #94a7c2;
  transform: translateY(-1px);
}

.product-detail-thumbnail.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(31, 99, 224, 0.16);
}

.product-detail-thumbnail:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.product-detail-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  object-fit: contain;
  object-position: center;
}

.product-detail-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 52px 34px 34px;
}

.product-detail-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  margin-top: 10px;
}

.product-detail-heading h2 {
  margin: 0;
  font-size: 25px;
  line-height: 1.3;
}

.product-detail-description {
  min-height: 66px;
  margin: 16px 0 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.product-detail-meta {
  display: grid;
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.product-detail-meta div {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.product-detail-meta div+div {
  border-top: 1px solid var(--line);
}

.product-detail-meta dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.product-detail-meta dd {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}

.product-detail-meta div:first-child dd {
  color: var(--accent-dark);
  font-size: 20px;
}

.product-detail-order {
  display: grid;
  grid-template-columns: auto 120px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding-top: 24px;
}

.product-detail-order label {
  font-size: 12px;
}

.product-detail-quantity {
  min-height: 40px;
}

.product-detail-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.product-detail-actions .button {
  min-height: 44px;
}

.product-detail-actions .button.secondary {
  border-color: #b9c9dd;
  background: #fff;
  color: var(--accent);
}

.product-detail-actions .button.secondary:hover {
  border-color: var(--accent);
  background: #f3f7fd;
  color: var(--accent-dark);
}

.service-notice {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: start;
  gap: 10px;
  padding: 15px 17px;
  color: var(--muted);
  font-size: 10px;
}

.notice-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  font-size: 15px;
}

.service-notice p {
  margin: 1px 0;
}

.service-notice .copyright {
  margin-top: 5px;
  color: var(--ink-soft);
  font-weight: 700;
}

.success {
  color: var(--success);
}

.error {
  color: var(--danger);
}

.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;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1050px) {
  .header-inner {
    grid-template-columns: 230px 1fr 220px;
  }

  .page-shell {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

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

  .product-card:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .header-inner {
    grid-template-columns: 1fr auto;
    min-height: 62px;
  }

  .top-nav {
    position: fixed;
    right: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 40;
    height: 54px;
    justify-content: space-around;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(14px);
  }

  .top-nav a {
    flex: 1;
  }

  .top-nav a::after {
    right: 30%;
    left: 30%;
  }

  .page-shell {
    grid-template-columns: 1fr;
    padding-bottom: 84px;
  }

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

  .search-control.open input,
  .search-control:focus-within input {
    width: 160px;
  }
}

@media (max-width: 620px) {

  .header-inner,
  .page-shell {
    width: min(100% - 20px, 1280px);
  }

  .brand-copy small {
    display: none;
  }

  .brand-copy strong {
    font-size: 16px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }

  .header-actions {
    gap: 1px;
  }

  .icon-button {
    width: 35px;
    height: 35px;
    flex-basis: 35px;
  }

  .search-control.open {
    position: absolute;
    right: 10px;
    left: 10px;
    z-index: 4;
  }

  .search-control.open input,
  .search-control:focus-within input {
    width: 100%;
  }

  .hero-card,
  .hero-copy {
    min-height: 300px;
  }

  .hero-copy {
    padding: 34px 26px;
  }

  .hero-copy h1 {
    font-size: 32px;
  }

  .hero-copy p {
    max-width: 320px;
    font-size: 13px;
  }

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

  .product-card:last-child {
    grid-column: auto;
  }

  .product-media {
    aspect-ratio: 16 / 8.7;
  }

  .product-detail-dialog {
    width: calc(100% - 20px);
    max-height: calc(100svh - 20px);
  }

  .product-detail-shell {
    max-height: calc(100svh - 20px);
  }

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

  .product-detail-media {
    min-height: 230px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .product-detail-main-image {
    min-height: 230px;
    aspect-ratio: 16 / 10;
  }

  .product-detail-main-image>img {
    max-height: 250px;
    padding: 28px;
  }

  .product-detail-main-image .image-fallback {
    min-height: 230px;
  }

  .product-detail-thumbnails {
    padding: 10px 14px 12px;
  }

  .product-detail-thumbnail {
    flex-basis: 64px;
    width: 64px;
    height: 52px;
  }

  .product-detail-copy {
    padding: 30px 22px 24px;
  }

  .product-detail-heading h2 {
    font-size: 21px;
  }

  .product-detail-description {
    min-height: 0;
  }

  .product-detail-order {
    margin-top: 0;
  }

  .catalog-head {
    align-items: flex-start;
  }

  .service-notice {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* Home layout */
.page-shell {
  grid-template-areas:
    "hero account"
    "catalog catalog"
    "notice notice";
}

.main-column,
.side-column {
  display: contents;
}

.hero-card {
  grid-area: hero;
}

.account-card {
  grid-area: account;
}

.catalog-section {
  grid-area: catalog;
}

.service-notice {
  grid-area: notice;
}

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

/* Orders dialog */
.orders-dialog {
  width: min(760px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 28px 70px rgba(18, 31, 50, 0.28);
}

.orders-dialog::backdrop {
  background: rgba(17, 28, 45, 0.46);
  backdrop-filter: blur(3px);
}

.orders-dialog-shell {
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 16px;
}

.orders-dialog-toolbar {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  font-weight: 800;
}

.orders-dialog .order-summary {
  padding: 0;
  border: 0;
  box-shadow: none;
}

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

@media (max-width: 820px) {
  .catalog-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .product-sort-control {
    justify-content: space-between;
  }

  .product-sort-control select {
    max-width: 220px;
    flex: 1;
  }

  .page-shell {
    grid-template-areas:
      "hero"
      "account"
      "catalog"
      "notice";
  }

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

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

/* Recently viewed products */
.recent-products-dialog {
  width: min(640px, calc(100% - 32px));
}

.recent-products-dialog .orders-dialog-shell {
  padding: 18px;
}

.recent-products-dialog .orders-dialog-toolbar {
  align-items: flex-end;
  margin-bottom: 12px;
}

.recent-products-dialog .orders-dialog-toolbar h2 {
  margin: 3px 0 0;
  font-size: 20px;
  line-height: 1.3;
}

.recent-products-dialog-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.recent-products-dialog-actions .text-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 11px;
}

.recent-products-list {
  display: grid;
  max-height: min(540px, calc(100dvh - 150px));
  gap: 8px;
  overflow-y: auto;
  padding-right: 3px;
  scrollbar-width: thin;
}

.recent-product-item {
  display: grid;
  width: 100%;
  min-height: 98px;
  grid-template-columns: 108px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 14px;
  padding: 8px 12px 8px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.recent-product-item:hover {
  border-color: #9fb5d2;
  background: #f8faff;
  box-shadow: 0 7px 18px rgba(27, 49, 78, 0.08);
  transform: translateY(-1px);
}

.recent-product-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.recent-product-media {
  display: grid;
  width: 108px;
  height: 80px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #e5eaf1;
  border-radius: 6px;
  background: #f7f8fa;
}

.recent-product-media img {
  display: block;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 10px;
  object-fit: contain;
  object-position: center;
}

.recent-product-media .image-fallback {
  min-height: 0;
}

.recent-product-media .image-fallback span {
  gap: 4px;
  font-size: 9px;
}

.recent-product-media .image-fallback svg {
  width: 22px;
  height: 22px;
}

.recent-product-copy {
  display: block;
  min-width: 0;
}

.recent-product-copy strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-product-copy small {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.recent-product-copy b {
  display: block;
  margin-top: 7px;
  color: var(--accent-dark);
  font-size: 13px;
}

.recent-product-item>svg {
  width: 18px;
  height: 18px;
  color: #8b98aa;
  stroke-width: 1.8;
}

@media (max-width: 620px) {
  .recent-products-dialog {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
  }

  .recent-products-dialog .orders-dialog-shell {
    padding: 14px;
  }

  .recent-products-dialog .orders-dialog-toolbar h2 {
    font-size: 18px;
  }

  .recent-product-item {
    min-height: 84px;
    grid-template-columns: 82px minmax(0, 1fr) 18px;
    gap: 10px;
    padding: 7px 9px 7px 7px;
  }

  .recent-product-media {
    width: 82px;
    height: 66px;
  }

  .recent-product-copy strong {
    font-size: 13px;
  }

  .recent-product-copy small {
    -webkit-line-clamp: 1;
  }
}

.wishlist-button {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: #6f7c8f;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.wishlist-button:hover {
  border-color: #ff9eaa;
  background: #fff5f6;
  color: #e5485d;
  transform: translateY(-1px);
}

.wishlist-button.selected {
  border-color: #ffc1c9;
  background: #fff0f2;
  color: #e5485d;
}

.wishlist-button svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.9;
}

.wishlist-button.selected svg {
  fill: currentColor;
}

.wishlist-header-button.wishlist-bump {
  transform-origin: center;
  animation: wishlist-button-bump 720ms ease;
}

.wishlist-header-button.wishlist-bump svg {
  animation: wishlist-heart-pop 720ms ease;
}

@keyframes wishlist-button-bump {

  0%,
  100% {
    transform: rotate(0) scale(1);
  }

  20% {
    transform: rotate(-12deg) scale(1.08);
  }

  40% {
    transform: rotate(10deg) scale(1.16);
  }

  60% {
    transform: rotate(-6deg) scale(1.1);
  }

  80% {
    transform: rotate(3deg) scale(1.04);
  }
}

@keyframes wishlist-heart-pop {

  0%,
  100% {
    color: currentColor;
    fill: transparent;
  }

  35%,
  70% {
    color: #e5484d;
    fill: #e5484d;
  }
}

@media (prefers-reduced-motion: reduce) {

  .wishlist-header-button.wishlist-bump,
  .wishlist-header-button.wishlist-bump svg {
    animation: none;
  }
}