:root {
  color-scheme: dark;
  --bg: #0a0b0d;
  /* Matte Charcoal Black */
  --surface: #121620;
  /* Technical Slate Gray */
  --surface-strong: #191f2d;
  /* Highlight surface */
  --line: rgba(255, 255, 255, 0.08);
  /* Technical divider */
  --line-strong: rgba(255, 255, 255, 0.22);
  /* Active boundary */
  --text: #f8f9fa;
  /* Stark Off-white */
  --muted: #868e96;
  /* Slate gray */
  --faint: #495057;
  /* Technical muted gray */
  --brand: #228be6;
  /* Cool Tech Blue */
  --brand-dark: #1c7ed6;
  --price: #fa5252;
  /* Warm Cherry Red */
  --danger: #e03131;
  --success: #2b8a3e;

  --font-sans: "Space Grotesk", "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --radius-sm: 4px;
  --radius-md: 8px;
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-width: 320px;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.005) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.005) 1px, transparent 1px);
  background-size: 60px 60px;
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

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

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

button {
  cursor: pointer;
}

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

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

/* ---------- Header ---------- */

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(10, 11, 13, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 28px;
  height: 60px;
  padding: 0 20px;
}

.brand-logo {
  flex: 0 0 auto;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  text-transform: uppercase;
}

.brand-logo span {
  color: var(--brand);
}

.mall-tabs {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.mall-tabs::-webkit-scrollbar {
  display: none;
}

.mall-tabs a {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 100%;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: -0.01em;
  transition: color 0.15s ease;
}

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

.mall-tabs a.active {
  color: var(--text);
  font-weight: 600;
}

.mall-tabs a.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--price);
  /* Cherry red active dot */
}

.header-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-text-link {
  height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.header-text-link:hover {
  color: var(--text);
}

.icon-link {
  position: relative;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: background 0.15s ease;
}

.icon-link:hover {
  background: var(--surface);
}

.icon-link svg {
  width: 21px;
  height: 21px;
}

.cart-count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--price);
  color: #fff;
  font-size: 9px;
  font-family: var(--font-mono);
  font-weight: 700;
  line-height: 1;
}

.cart-count[data-empty="true"] {
  display: none;
}

/* ---------- Layout ---------- */

.app-main {
  max-width: var(--container);
  width: 100%;
  margin: 0 auto;
  padding: 0 20px 64px;
}

.category-row {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 24px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.category-row::-webkit-scrollbar {
  display: none;
}

.category-row a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.15s ease;
}

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

.category-row a.selected {
  color: var(--text);
  font-weight: 600;
  position: relative;
}

.category-row a.selected::after {
  content: "";
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--brand);
  /* Tech blue category dot indicator */
}

.toolbar-band {
  padding: 16px 0 22px;
}

.product-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 170px 150px minmax(230px, 280px) 92px;
  gap: 10px;
  align-items: stretch;
  overflow: visible;
}

.search-field {
  position: relative;
  display: block;
  min-width: 0;
}

.search-field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-field input,
.checkout-form input,
.detail-cart-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  padding: 0 14px;
  outline: none;
  font-size: 14px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.search-field input {
  padding-left: 42px;
}

.search-field input::placeholder,
.price-field input::placeholder {
  color: var(--muted);
  opacity: 0.65;
}

.search-field input:focus,
.checkout-form input:focus,
.detail-cart-form input:focus,
.quantity-control input:focus {
  border-color: var(--line-strong);
  background: var(--surface-strong);
}

.filter-dropdown {
  position: relative;
  min-width: 0;
}

.filter-dropdown-trigger {
  min-height: 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 12px;
  align-content: center;
  gap: 2px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 6px 12px;
  cursor: pointer;
  list-style: none;
  transition: border-color 0.15s ease;
}

.filter-dropdown-trigger::-webkit-details-marker {
  display: none;
}

.filter-dropdown-trigger::after {
  content: "";
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.15s ease;
}

.filter-dropdown[open] .filter-dropdown-trigger {
  border-color: var(--line-strong);
}

.filter-dropdown[open] .filter-dropdown-trigger::after {
  transform: translateY(1px) rotate(225deg);
}

.filter-dropdown-kicker {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.filter-dropdown-trigger strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-dropdown-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 15;
  display: grid;
  gap: 2px;
  min-width: max-content;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.filter-dropdown-option {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.filter-dropdown-option:hover {
  background: var(--surface);
  color: var(--text);
}

.filter-dropdown-option.selected {
  background: var(--brand);
  color: #fff;
}

.price-filter {
  min-height: 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color 0.15s ease;
}

.price-filter:focus-within {
  border-color: var(--line-strong);
}

.price-field {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 0 12px;
}

.price-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

.price-field input {
  width: 100%;
  min-width: 0;
  height: 42px;
  border: 0;
  background: transparent;
  outline: none;
  padding: 0;
  font-size: 13px;
  color: var(--text);
  font-family: var(--font-mono);
  /* Monospace price range inputs */
}

.price-divider {
  width: 1px;
  height: 20px;
  background: var(--line);
}

.search-submit {
  min-height: 44px;
  gap: 7px;
  border-radius: var(--radius-md);
}

.search-submit svg {
  width: 17px;
  height: 17px;
}

.button {
  min-height: 38px;
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

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

.button:active {
  transform: scale(0.97);
  /* Tactile click switch sensation */
}

.button.secondary {
  border-color: var(--line);
  background: transparent;
  color: var(--text);
}

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

.button.wide {
  width: 100%;
}

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

.product-toolbar .search-field {
  height: 44px;
}

.product-toolbar .search-field-icon,
.product-toolbar .search-submit svg {
  flex: 0 0 auto;
  max-width: none;
}

.product-toolbar .search-field-icon {
  width: 18px;
  height: 18px;
}

.product-toolbar .search-submit.button {
  min-height: 44px;
  border-radius: var(--radius-md);
}

.product-toolbar .search-submit svg {
  width: 17px;
  height: 17px;
}

.ranking-section {
  padding-top: 8px;
}

.ranking-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  height: 40px;
  margin-bottom: 4px;
}

.ranking-title-row h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.result-count {
  color: var(--faint);
  font-size: 13px;
  font-weight: 600;
}

/* ---------- Product grid & card ---------- */

.product-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  column-gap: 16px;
  row-gap: 28px;
}

.product-card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    background-color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover {
  transform: translateY(-3px);
  background: var(--surface-strong);
  border-color: var(--line-strong);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.product-image-wrap {
  position: relative;
}

.product-image-link {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: calc(var(--radius-md) - 2px);
  background: rgba(255, 255, 255, 0.02);
}

.detail-media img,
.cart-row img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-image-link img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover .product-image-link img {
  transform: scale(1.05);
}

.wish-button {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(18, 22, 32, 0.85);
  color: var(--muted);
  border: 1px solid var(--line);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.wish-button:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.wish-button svg {
  width: 15px;
  height: 15px;
}

.wish-button.selected {
  background: var(--price);
  color: #fff;
  border-color: var(--price);
}

.status-badge {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  height: 20px;
  border-radius: var(--radius-sm);
  padding: 0 6px;
  font-size: 10px;
  font-family: var(--font-mono);
  /* Monospace tech badge */
  font-weight: 700;
  text-transform: uppercase;
}

.status-badge.low-stock {
  background: rgba(250, 82, 82, 0.15);
  color: var(--price);
  border: 1px solid rgba(250, 82, 82, 0.3);
}

.status-badge.sold-out {
  background: rgba(0, 0, 0, 0.7);
  color: var(--muted);
  border: 1px solid var(--line);
}

.product-image-link.is-sold-out img {
  opacity: 0.3;
}

.product-card-body {
  display: grid;
  gap: 3px;
  padding-top: 10px;
}

.product-name {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  transition: color 0.15s ease;
}

.product-card:hover .product-name {
  color: var(--text);
}

.list-price {
  min-height: 16px;
  margin-top: 2px;
  color: var(--faint);
  font-size: 12px;
  font-family: var(--font-mono);
  /* Monospace list price */
  font-weight: 400;
  text-decoration: line-through;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: -1px;
}

.discount-rate {
  color: var(--price);
  font-size: 15px;
  font-family: var(--font-mono);
  /* Monospace discount */
  font-weight: 700;
}

.price-row strong {
  color: var(--text);
  font-size: 18px;
  font-family: var(--font-mono);
  /* Monospace price */
  font-weight: 700;
  letter-spacing: -0.01em;
}

.review-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 18px;
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--font-mono);
  /* Monospace review numbers */
  font-weight: 500;
}

.review-star {
  color: #fab005;
  /* Seeker orange-yellow */
  font-size: 13px;
  line-height: 1;
}

.review-divider {
  color: var(--faint);
}

.cart-button {
  width: 100%;
  margin-top: 8px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  min-height: 34px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.cart-button:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* ---------- Page heading & detail ---------- */

.page-heading {
  margin: 28px 0 20px;
}

.page-heading h1,
.detail-panel h1,
.order-complete h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(320px, 500px) minmax(300px, 1fr);
  gap: 48px;
  align-items: start;
  max-width: 1080px;
  margin: 32px auto 0;
}

.detail-media {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
}

.detail-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 4px;
}

.detail-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.back-link {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.back-link:hover {
  color: var(--text);
}

.category-pill,
.stock-pill,
.tag-row > span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
}

.category-pill {
  width: fit-content;
}

.tag-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.product-meta-row,
.product-action-row,
.button-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.product-action-row strong {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font-mono);
  /* Monospace detail page price */
}

.info-list,
.summary-panel dl {
  display: grid;
  gap: 0;
  margin: 0;
}

.info-list div,
.summary-panel dl div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

dt {
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
}

dd {
  margin: 0;
  font-weight: 600;
  font-size: 13px;
  font-family: var(--font-mono);
  /* Monospace spec/order metrics */
}

.detail-cart-form {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
}

/* ---------- Cart & checkout ---------- */

.cart-layout,
.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.cart-list,
.order-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line-strong);
}

.cart-row {
  min-height: 108px;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 132px 108px 36px;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  /* Transparent background for clean integration */
}

.cart-row img {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
}

.cart-row-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.cart-row-main strong,
.cart-row-main span {
  overflow-wrap: anywhere;
}

.cart-row-main strong {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.cart-row-main span {
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
  font-family: var(--font-mono);
  /* Monospace cart attributes */
}

.quantity-control {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  gap: 0;
  align-items: center;
}

.quantity-control input {
  width: 100%;
  height: 32px;
  border: 1px solid var(--line);
  border-left: 0;
  border-right: 0;
  background: var(--surface);
  color: var(--text);
  text-align: center;
  font-family: var(--font-mono);
  /* Monospace quantity */
  font-size: 13px;
  outline: none;
}

.square-button {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

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

.square-button:active {
  transform: scale(0.92);
  /* Tactile small button click */
}

.square-button.danger {
  color: var(--price);
  border-color: var(--line);
  background: var(--surface);
}

.square-button.danger:hover {
  background: rgba(250, 82, 82, 0.12);
  border-color: var(--price);
}

.line-total {
  text-align: right;
  font-size: 15px;
  font-family: var(--font-mono);
  /* Monospace line total */
  font-weight: 700;
}

.summary-panel,
.checkout-form,
.order-complete {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  /* Darker panel container */
}

.summary-panel {
  position: sticky;
  top: 84px;
}

.summary-panel h2,
.checkout-form h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.checkout-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.order-preview,
.order-items {
  display: grid;
  gap: 0;
}

.order-preview div,
.order-items div,
.order-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.order-preview span,
.order-items span,
.order-list-row span {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.order-complete {
  width: min(640px, 100%);
  margin: 32px auto 0;
  text-align: left;
}

.complete-mark {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
}

.complete-mark svg {
  width: 22px;
  height: 22px;
}

.order-complete p {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
}

.order-list {
  background: transparent;
}

.order-list-row {
  min-height: 60px;
}

.order-list-row span:first-child {
  font-weight: 600;
}

/* ---------- Empty / status states ---------- */

.empty-state,
.page-status {
  min-height: 300px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.empty-state.inline {
  grid-column: 1 / -1;
}

.empty-state h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.empty-mark {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-strong);
  color: var(--muted);
}

.empty-mark svg {
  width: 20px;
  height: 20px;
}

.page-status.error {
  color: var(--danger);
  font-family: var(--font-mono);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  max-width: min(360px, calc(100vw - 40px));
  transform: translateY(20px);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
  font-size: 13px;
  padding: 12px 16px;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

/* ---------- Responsive ---------- */

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

@media (max-width: 960px) {
  .header-inner {
    gap: 16px;
  }

  .mall-tabs {
    gap: 16px;
  }

  .mall-tabs a {
    font-size: 14px;
  }

  .product-toolbar,
  .detail-layout,
  .cart-layout,
  .checkout-layout {
    grid-template-columns: 1fr;
  }

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

  .summary-panel {
    position: static;
  }

  .cart-row {
    grid-template-columns: 76px minmax(0, 1fr) 124px 36px;
  }

  .line-total {
    grid-column: 2 / 4;
    text-align: left;
  }
}

@media (max-width: 640px) {
  .header-inner {
    height: 54px;
    padding: 0 14px;
    gap: 12px;
  }

  .brand-logo {
    font-size: 17px;
  }

  .app-main {
    padding: 0 14px 48px;
  }

  .category-row a {
    font-size: 13px;
  }

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

  .product-name {
    font-size: 13px;
  }

  .price-row strong {
    font-size: 15px;
  }

  .cart-row {
    grid-template-columns: 72px minmax(0, 1fr) 36px;
  }

  .quantity-control {
    grid-column: 1 / 4;
    width: 150px;
  }

  .line-total {
    grid-column: 1 / 3;
  }

  .detail-cart-form,
  .button-row {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .button-row .button {
    width: 100%;
  }
}

/* ---------- Naver / 11st Style Search Hero & Filter Band ---------- */

.search-hero-section {
  padding: 32px 0 20px;
  text-align: center;
}

.mall-search-bar-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.mall-search-bar {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 580px;
  height: 48px;
  border: 2px solid var(--brand);
  border-radius: 24px;
  background: var(--surface);
  padding-left: 20px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mall-search-bar:focus-within {
  border-color: var(--brand-dark);
  box-shadow: 0 4px 16px rgba(34, 139, 230, 0.25);
}

.mall-search-bar input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: none;
  font-size: 15px;
  padding: 0;
  height: 100%;
}

.mall-search-bar .search-shortcut {
  position: absolute;
  right: 60px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--muted);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.mall-search-bar input:focus ~ .search-shortcut {
  opacity: 0;
}

.mall-search-btn {
  width: 48px;
  height: 100%;
  background: var(--brand);
  border: 0;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

.mall-search-btn:hover {
  background: var(--brand-dark);
}

.trending-keywords {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

.keyword-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.keyword-tag {
  color: var(--brand);
  font-size: 13px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(34, 139, 230, 0.06);
  transition: background 0.15s ease, color 0.15s ease;
}

.keyword-tag:hover {
  background: rgba(34, 139, 230, 0.14);
  color: var(--text);
}

/* Filter Action Band */
.filter-action-band {
  border-bottom: 1px solid var(--line);
  padding: 12px 0 16px;
  margin-bottom: 16px;
}

.product-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.filter-inputs-group {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}

/* Slim Single-Line Category Dropdown */
.filter-inputs-group .filter-dropdown {
  position: relative;
}

.filter-dropdown-trigger {
  min-height: 36px !important;
  height: 36px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 0 12px;
  cursor: pointer;
  list-style: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.filter-dropdown-trigger:hover {
  border-color: var(--line-strong);
}

.filter-dropdown-trigger::after {
  display: none !important; /* Hide old CSS grid arrow since ▾ is in text */
}

.filter-dropdown-label-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.filter-dropdown-label-text strong {
  color: var(--text);
  font-weight: 600;
}

/* Slim Price Range inputs */
.filter-inputs-group .price-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0 !important;
  background: transparent !important;
  padding: 0;
  min-height: 36px !important;
  height: 36px;
}

.price-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 110px;
}

.price-field-wrap input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  padding: 0 24px 0 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.price-field-wrap input:focus {
  border-color: var(--line-strong);
  background: var(--surface-strong);
}

.price-field-wrap .currency-label {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--muted);
  pointer-events: none;
}

.price-range-tilde {
  color: var(--muted);
  font-size: 14px;
  margin: 0 2px;
}

/* One-Click Sorting text links */
.sort-tabs-group {
  margin-left: auto; /* Push to the right end */
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-tab-btn {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  padding: 4px 6px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.sort-tab-btn:hover {
  color: var(--text);
}

.sort-tab-btn.active {
  color: var(--brand);
  font-weight: 700;
}

.sort-tab-divider {
  color: var(--faint);
  font-size: 8px;
  pointer-events: none;
}

/* ---------- Final Visual Refinements & Decorators ---------- */

/* Tech border frames for product image boxes */
.tech-frame {
  position: relative;
  padding: 1px;
  background: transparent;
  border-radius: var(--radius-md);
}

.tech-frame::before,
.tech-frame::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border: 1px solid var(--brand);
  pointer-events: none;
  z-index: 3;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.tech-frame::before {
  top: -1px;
  left: -1px;
  border-right: 0;
  border-bottom: 0;
}

.tech-frame::after {
  bottom: -1px;
  right: -1px;
  border-left: 0;
  border-top: 0;
}

.product-card:hover .tech-frame::before,
.tech-frame:hover::before,
.tech-frame:focus-within::before {
  transform: translate(-2px, -2px);
  border-color: var(--price); /* Shift to Cherry Red on hover */
}

.product-card:hover .tech-frame::after,
.tech-frame:hover::after,
.tech-frame:focus-within::after {
  transform: translate(2px, 2px);
  border-color: var(--price);
}

/* Microchip-like tag badges on cards */
.card-tag-row {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.card-tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--brand);
  background: rgba(34, 139, 230, 0.08);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: var(--font-mono);
  border: 1px solid rgba(34, 139, 230, 0.12);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.product-card:hover .card-tag {
  background: rgba(34, 139, 230, 0.14);
  border-color: rgba(34, 139, 230, 0.3);
}

/* Monospace digital rating dot-gauges & boxed rows */
.review-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  padding: 3px 8px;
  margin-top: 8px;
  font-size: 11px;
}

/* Segmented LED Gauge Indicators */
.gauge-dots-container {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}

.gauge-dot {
  width: 7px;
  height: 7px;
  background: rgba(255, 255, 255, 0.12); /* Inactive dot */
  border-radius: 1px;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.gauge-dot.active {
  background: #fab005; /* Active LED amber */
  box-shadow: 0 0 3px rgba(250, 176, 5, 0.6); /* LED ambient glow */
}

.review-rating {
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-mono);
}

.review-divider {
  color: var(--line-strong);
}

.review-count {
  color: var(--muted);
  font-weight: 500;
}

.detail-rating-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  padding: 3px 8px;
  font-size: 12px;
}

.detail-rating-chip span {
  min-height: auto !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.detail-rating-chip .gauge-dot {
  display: inline-block !important;
  width: 7px !important;
  height: 7px !important;
  border-radius: 1px !important;
  background: rgba(255, 255, 255, 0.12) !important; /* Inactive cell color */
}

.detail-rating-chip .gauge-dot.active {
  background: #fab005 !important; /* Glowing LED Amber active color */
  box-shadow: 0 0 3px rgba(250, 176, 5, 0.6) !important;
}

/* Tech Datasheet specifications grid for detail page */
.spec-datasheet-grid {
  display: block !important;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-top: 12px;
}

.spec-datasheet-grid div {
  display: grid !important;
  grid-template-columns: 120px 1fr;
  padding: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  min-height: 38px;
}

.spec-datasheet-grid dt {
  background: var(--surface-strong);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  border-right: 1px solid var(--line);
}

.spec-datasheet-grid dd {
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  font-family: var(--font-mono);
}

/* ---------- Auth & MyPage ---------- */

.auth-layout {
  display: flex;
  justify-content: center;
}

.auth-form {
  width: min(420px, 100%);
}

.auth-form-hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  opacity: 0.8;
}

.checkout-form input {
  font-size: 13px;
}

.checkout-form input::placeholder {
  color: var(--muted);
  opacity: 0.5;
  font-size: 12px;
}

.auth-form .checkout-form {
  gap: 20px;
}

.checkout-form input:disabled {
  color: var(--muted);
  background: var(--surface-strong);
  cursor: not-allowed;
}

.checkbox-label {
  display: flex !important;
  flex-direction: row-reverse;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  color: var(--text) !important;
}

.checkbox-label input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

.mypage-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 24px;
  align-items: start;
}

.mypage-column {
  display: grid;
  gap: 20px;
}

.mypage-column .summary-panel {
  position: sticky;
  top: 84px;
}

.address-list {
  display: grid;
  gap: 10px;
}

.address-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
}

.address-row-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.address-row-main strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.address-row-main span {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.address-row-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.default-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  border-radius: var(--radius-sm);
  padding: 0 6px;
  background: rgba(34, 139, 230, 0.14);
  color: var(--brand);
  font-size: 10px;
  font-weight: 700;
}

.address-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.empty-inline-text {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 960px) {
  .mypage-layout {
    grid-template-columns: 1fr;
  }

  .mypage-column .summary-panel {
    position: static;
  }
}

/* ---------- Header User Status Area ---------- */
.header-user-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  padding: 2px 10px;
  border-radius: var(--radius-sm);
  height: 32px;
  margin-right: 6px;
  transition: border-color 0.15s ease;
}

.header-user-group:hover,
.header-user-group:focus-within {
  border-color: var(--line-strong);
}

.header-user-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s ease;
}

.header-user-link:hover {
  color: var(--brand);
}

.header-user-status-dot {
  width: 6px;
  height: 6px;
  background: #40c057; /* Online green */
  border-radius: 50%;
  box-shadow: 0 0 4px #40c057;
  display: inline-block;
}

.header-logout-btn {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.15s ease;
  text-transform: uppercase;
  border-left: 1px solid var(--line);
  padding-left: 8px;
  height: 14px;
  display: inline-flex;
  align-items: center;
}

.header-logout-btn:hover {
  color: var(--price); /* Warm cherry red on hover logout */
}