:root {
  --bg: #060606;
  --surface: rgba(255, 255, 255, 0.025);
  --surface-2: rgba(255, 255, 255, 0.045);
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #e8e8e8;
  --muted: rgba(255, 255, 255, 0.38);
  --faint: rgba(255, 255, 255, 0.2);
  --accent: rgba(190, 150, 255, 0.72);
  --radius: 12px;
  --radius-pill: 999px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-hover: cubic-bezier(0.16, 1, 0.3, 1);
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Playfair Display", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body {
  line-height: 1.5;
  position: relative;
  font-weight: 300;
}

.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: var(--bg);
}

.ambient-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  filter: blur(0.7px);
  opacity: 0.92;
}

.ambient-glow {
  position: absolute;
  pointer-events: none;
  z-index: 1;
}

.ambient-glow--left {
  top: -6%;
  left: -5%;
  width: min(420px, 55vw);
  height: min(420px, 55vw);
  background: radial-gradient(ellipse at center, rgba(180, 120, 255, 0.07) 0%, transparent 65%);
}

.ambient-glow--right {
  bottom: -8%;
  right: -6%;
  width: min(340px, 48vw);
  height: min(340px, 48vw);
  background: radial-gradient(ellipse at center, rgba(255, 100, 80, 0.045) 0%, transparent 65%);
}

@media (prefers-reduced-motion: reduce) {
  .ambient-canvas {
    display: none;
  }
}

@keyframes dp-rise {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dp-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.reveal {
  opacity: 0;
  animation: dp-rise 0.9s var(--ease) forwards;
}

.reveal-d1 { animation-delay: 0.1s; }
.reveal-d2 { animation-delay: 0.2s; }
.reveal-d3 { animation-delay: 0.35s; }
.reveal-d4 { animation-delay: 0.5s; }
.reveal-d5 { animation-delay: 0.65s; }
.reveal-d6 { animation-delay: 0.8s; }

.app {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 64px;
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 20px 0 0;
  background: linear-gradient(180deg, rgba(6, 6, 6, 0.94) 70%, rgba(6, 6, 6, 0));
  backdrop-filter: blur(12px);
}

.header-row {
  display: grid;
  grid-template-columns: 1fr minmax(200px, 420px) auto;
  gap: 20px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.header-row:not(:has(.search-wrap)) {
  grid-template-columns: 1fr auto;
}

.brand-title {
  margin: 0;
  font-size: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.brand-link {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  padding: 0;
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: opacity 0.2s var(--ease);
}

.brand-link:hover {
  opacity: 0.88;
  text-decoration: none;
}

.brand-name {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.brand-tld {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.brand-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 0;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 200;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.fish-svg {
  flex-shrink: 0;
  overflow: visible;
  user-select: none;
}

.fish-text {
  font-family: "JetBrains Mono", ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
  font-size: 10px;
  text-shadow: 0 0 12px rgba(168, 85, 247, 0.35);
}

.search-wrap {
  position: relative;
}

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

.search-wrap input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  padding: 0 36px 0 40px;
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.search-wrap input[type="search"]::-webkit-search-decoration,
.search-wrap input[type="search"]::-webkit-search-results-button,
.search-wrap input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.search-wrap input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-right: 2px;
  cursor: pointer;
  opacity: 0.42;
  background: center / 12px 12px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255%2C255%2C255%2C0.72)' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M18 6L6 18M6 6l12 12'/%3E%3C/svg%3E");
  transition: opacity 0.15s var(--ease);
}

.search-wrap input[type="search"]::-webkit-search-cancel-button:hover {
  opacity: 0.72;
}

.search-wrap input::placeholder {
  color: var(--faint);
}

.search-wrap input:focus {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.15s var(--ease);
}

.cart-btn:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.cart-btn:active {
  transform: scale(0.98);
}

.cart-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.1);
  font-size: 11px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
}

/* —— Categories —— */
.cat-bar {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding: 14px 0 12px;
  margin: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.cat-bar::-webkit-scrollbar {
  display: none;
}

.cat-btn {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  transition: color 0.22s var(--ease), background 0.22s var(--ease);
}

.cat-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.cat-btn.active {
  color: var(--text);
  background: var(--surface-2);
}

.cat-btn.active::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 4px;
  height: 2px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 1px;
  animation: bar-in 0.28s var(--ease);
}

@keyframes bar-in {
  from {
    transform: scaleX(0);
    opacity: 0;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

/* —— Sort dropdown —— */
.toolbar {
  display: flex;
  justify-content: flex-end;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.sort-dropdown {
  position: relative;
  z-index: 1;
}

.sort-dropdown.open {
  z-index: 200;
}

.sort-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.sort-trigger:hover,
.sort-dropdown.open .sort-trigger {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.sort-trigger-label {
  color: rgba(255, 255, 255, 0.88);
  white-space: nowrap;
}

.sort-chevron {
  color: rgba(255, 255, 255, 0.45);
  transition: transform 0.22s var(--ease);
}

.sort-dropdown.open .sort-chevron {
  transform: rotate(180deg);
  color: rgba(255, 255, 255, 0.65);
}

.sort-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 201;
  min-width: 188px;
  margin: 0;
  padding: 4px;
  list-style: none;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #0d0d0d;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.sort-menu.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.sort-option {
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.sort-option:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.95);
}

.sort-option.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.sort-option.active::before {
  content: "✓ ";
  opacity: 0.7;
  font-size: 11px;
}

/* —— Main grid —— */
.main {
  padding-top: 24px;
}

.status {
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--muted);
  animation: fade-in 0.35s var(--ease);
}

.status.error {
  border-color: rgba(239, 68, 68, 0.25);
  color: rgba(254, 202, 202, 0.95);
}

.main > .status {
  margin: 0 0 16px;
}

.hidden {
  display: none !important;
}

/* —— Smooth browse / product transitions —— */
#browseView {
  position: relative;
  min-height: 140px;
}

#browseView > .home-view,
#browseView > .grid {
  width: 100%;
  transition:
    opacity 0.48s var(--ease),
    transform 0.48s var(--ease),
    visibility 0.48s var(--ease);
}

#browseView > .home-view.hidden,
#browseView > .grid.hidden {
  position: absolute !important;
  top: 0;
  left: 0;
  right: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(14px);
}

#browseView > .grid.hidden {
  display: grid !important;
}

#browseView > .home-view.hidden {
  display: block !important;
}

#browseView > .home-view:not(.hidden),
#browseView > .grid:not(.hidden) {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

#browseView .grid.is-swapping {
  opacity: 0.4;
  transform: translateY(10px);
  pointer-events: none;
}

/* —— Typewriter —— */
.type-slot {
  display: inline;
}

.type-cursor::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 0.95em;
  margin-left: 2px;
  vertical-align: -0.08em;
  background: rgba(190, 150, 255, 0.75);
  animation: cursor-blink 1.05s step-end infinite;
}

.home-eyebrow .type-cursor::after {
  height: 1em;
  background: rgba(255, 255, 255, 0.35);
}

.home-title .type-cursor::after {
  height: 0.82em;
  background: rgba(255, 255, 255, 0.5);
}

@keyframes cursor-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.home-tld-wait,
.home-lead-wait,
.home-stats-wait {
  opacity: 0;
  transform: translateY(8px);
}

.home-tld-wait.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}

.home-lead-wait.is-typing,
.home-lead-wait.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.home-lead-wait.is-visible {
  transition: opacity 0.55s var(--ease);
}

.home-stats-wait.is-visible .home-stat {
  opacity: 1;
  transform: translateY(0);
}

.home-stats-wait.is-visible .home-stat:nth-child(1) {
  transition-delay: 0s;
}

.home-stats-wait.is-visible .home-stat:nth-child(2) {
  transition-delay: 0.08s;
}

.home-stats-wait.is-visible .home-stat:nth-child(3) {
  transition-delay: 0.16s;
}

/* —— Home —— */
.home-view {
  padding: 8px 0 32px;
}

.home-loading {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  padding: 48px 0;
}

.home-hero {
  text-align: center;
  padding: 64px 12px 56px;
  max-width: 680px;
  margin: 0 auto;
  position: relative;
  min-height: 320px;
}

.home-eyebrow {
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 200;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}

.home-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.35rem, 7.5vw, 3.25rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.home-title-name {
  color: #fff;
}

.home-title-tld {
  color: rgba(255, 255, 255, 0.32);
  font-style: italic;
}

.home-lead {
  margin: 20px auto 0;
  max-width: 400px;
  font-size: 14px;
  font-weight: 200;
  line-height: 1.85;
  color: var(--muted);
}

.home-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.home-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}

.home-stat-n {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.02em;
  color: rgba(255, 255, 255, 0.88);
}

.home-stat-l {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.28);
}

.home-actions {
  display: flex;
  justify-content: center;
  margin-bottom: 48px;
}

.home-cta {
  height: 44px;
  padding: 0 28px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.94);
  color: #0a0a0a;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s var(--ease), transform 0.15s var(--ease);
}

.home-cta:hover {
  background: #fff;
}

.home-cta:active {
  transform: scale(0.98);
}

.home-section-label {
  margin: 0 0 14px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.home-categories {
  max-width: 720px;
  margin: 0 auto 48px;
}

.home-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.home-cat-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.15s var(--ease);
}

.home-cat-tile:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  transform: translateY(-1px);
}

.home-cat-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.home-cat-count {
  font-size: 11px;
  color: var(--muted);
}

.home-featured {
  max-width: 720px;
  margin: 0 auto;
}

.home-feat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.home-feat-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  cursor: pointer;
  font-family: var(--font);
  text-align: left;
  color: inherit;
  transition: border-color 0.2s var(--ease), transform 0.15s var(--ease);
}

.home-feat-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.home-feat-img {
  aspect-ratio: 1 / 1;
  background: #060606;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-feat-img img {
  max-width: 88%;
  max-height: 88%;
  object-fit: contain;
}

.home-feat-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
}

.home-feat-name {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-feat-price {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

body.is-home-view .site-header {
  border-bottom: none;
}

body.is-home-view .header-row {
  border-bottom-color: transparent;
  padding-bottom: 12px;
}

body.is-home-view .cat-bar {
  justify-content: center;
  padding-top: 8px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.grid.hidden {
  display: none !important;
}

.grid.is-loading {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}

.card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(18px);
  box-shadow: none;
  transition:
    border-color 0.35s var(--ease-hover),
    transform 0.35s var(--ease-hover),
    background-color 0.35s var(--ease-hover);
  backface-visibility: hidden;
}

.card-reveal {
  animation: dp-rise 0.8s var(--ease) forwards;
}

.card-clickable {
  cursor: pointer;
}

.card-clickable::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(circle at 50% 0%, rgba(190, 150, 255, 0.09) 0%, transparent 68%);
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}

.card-clickable:hover::after {
  opacity: 1;
}

.card-clickable:hover {
  border-color: rgba(255, 255, 255, 0.1);
  background: #0d0d0d;
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.card-clickable:active {
  transform: translateY(-1px);
  transition-duration: 0.2s;
}

.card-clickable:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.25);
  outline-offset: 2px;
}

@keyframes card-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.card-head {
  padding: 14px 14px 0;
}

.chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.45);
}

.card-title {
  margin: 10px 0 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.01em;
  min-height: 2.5em;
  color: rgba(255, 255, 255, 0.88);
}

.card-img {
  margin: 12px 14px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: #060606;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-img img {
  max-width: 92%;
  max-height: 92%;
  object-fit: contain;
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0) scale(1);
  transition: transform 0.55s var(--ease-hover);
}

.card-cta {
  display: block;
  margin: 0 14px 14px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  text-align: center;
  transition: color 0.42s var(--ease-hover);
}

.card-clickable:hover .card-cta {
  color: rgba(196, 181, 253, 0.9);
}

.card-clickable:hover .card-img img {
  transform: translateZ(0) scale(1.04);
}

.card-img .placeholder {
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.card-variant {
  margin: 0 14px 10px;
}

.card-variant select {
  width: 100%;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-family: var(--font);
  padding: 0 10px;
  outline: none;
  cursor: pointer;
  color-scheme: dark;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.45)' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.card-variant select:focus {
  border-color: var(--border-strong);
}

.card-variant select option {
  background: #0d0d0d;
  color: #ffffff;
}

.card-foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}

.stock {
  font-size: 11px;
  color: var(--muted);
}

.stock.low {
  color: rgba(251, 191, 36, 0.9);
}

.stock.ok {
  color: rgba(134, 239, 172, 0.85);
}

.price {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.add-btn {
  width: calc(100% - 28px);
  margin: 0 14px 14px;
  height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: #0a0a0a;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s var(--ease), transform 0.15s var(--ease), opacity 0.2s;
}

.add-btn:hover {
  background: #fff;
}

.add-btn:active {
  transform: scale(0.98);
}

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

/* —— Cart drawer —— */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 20;
  opacity: 0;
  transition: opacity 0.28s var(--ease);
  pointer-events: none;
}

.backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(380px, 100vw);
  height: 100%;
  background: var(--bg);
  border-left: 1px solid var(--border);
  z-index: 30;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s var(--ease);
}

.drawer.open {
  transform: translateX(0);
}

.drawer.hidden {
  display: flex !important;
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 18px;
  border-bottom: 1px solid var(--border);
}

.drawer-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.drawer-head button {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.2s;
}

.drawer-head button:hover {
  color: var(--text);
}

.cart-list {
  list-style: none;
  margin: 0;
  padding: 8px 18px;
  flex: 1;
  overflow: auto;
}

.cart-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  animation: fade-in 0.3s var(--ease);
}

.cart-list .cart-empty {
  color: var(--muted);
}

.cart-line-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.cart-line-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cart-line-info strong {
  font-weight: 600;
  font-size: 13px;
}

.cart-line-variant {
  color: var(--muted);
  font-size: 12px;
}

.cart-line-remove {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.cart-line-remove:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

.cart-line-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.cart-line-qty {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cart-qty-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s var(--ease);
}

.cart-qty-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
}

.cart-qty-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.cart-qty-input {
  width: 42px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  text-align: center;
  font-size: 13px;
  font-family: var(--font);
  -moz-appearance: textfield;
}

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

.cart-line-total {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.cart-list .line-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.drawer-foot {
  padding: 18px;
  border-top: 1px solid var(--border);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 14px;
}

.cart-total span:last-child {
  font-weight: 600;
}

.checkout-btn {
  width: 100%;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font-family: var(--font-mono);
  font-weight: 300;
  font-size: 11px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: color 0.4s var(--ease), border-color 0.4s, transform 0.4s var(--ease);
}

.checkout-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.38);
  transform: translateY(-1px);
}

.checkout-btn:active {
  transform: scale(0.99);
}

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

.checkout-note {
  margin: 12px 0 0;
  font-size: 11px;
  color: var(--faint);
  line-height: 1.5;
}

@media (max-width: 768px) {
  .home-hero {
    padding: 32px 8px 28px;
  }

  .home-stats {
    gap: 20px;
  }

  .home-stat-n {
    font-size: 18px;
  }

  .header-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .search-wrap {
    order: 3;
  }

  .cart-btn {
    justify-self: start;
  }

  .sort-dropdown {
    width: 100%;
  }

  .sort-trigger {
    width: 100%;
    justify-content: space-between;
  }

  .sort-menu {
    left: 0;
    right: 0;
    min-width: 0;
  }
}

/* —— Product detail —— */
.product-view:not(.hidden) {
  animation: panel-in 0.5s var(--ease) forwards;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 20px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-family: var(--font);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.product-back:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

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

.product-gallery {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-main-img {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #060606;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-main-img img {
  max-width: 92%;
  max-height: 92%;
  object-fit: contain;
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.product-purchase {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.product-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.product-price {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
  white-space: nowrap;
}

.product-title {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #fff;
}

.brand-chip {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.45);
}

.product-category {
  margin: 6px 0 0;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.28);
}

.product-buy-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: visible;
}

.variant-picker {
  overflow: visible;
}

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

.variant-field-static,
.variant-trigger {
  width: 100%;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.variant-field-static {
  cursor: default;
}

.variant-dropdown {
  position: relative;
  z-index: 1;
}

.variant-dropdown.open {
  z-index: 200;
}

.variant-trigger {
  outline: none;
  cursor: pointer;
}

.variant-trigger:hover,
.variant-dropdown.open .variant-trigger {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.variant-trigger:focus-visible {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.25);
}

.variant-chevron {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.45);
  transition: transform 0.22s var(--ease), color 0.2s var(--ease);
}

.variant-dropdown.open .variant-chevron {
  transform: rotate(180deg);
  color: rgba(255, 255, 255, 0.65);
}

.variant-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 201;
  margin: 0;
  padding: 4px;
  list-style: none;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #0d0d0d;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  max-height: 220px;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top center;
  pointer-events: none;
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}

.variant-menu.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.variant-option {
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.variant-option:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.95);
}

.variant-option.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.field-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.product-select {
  width: 100%;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  padding: 0 12px;
  outline: none;
  cursor: pointer;
  color-scheme: dark;
}

.product-select:focus {
  border-color: var(--border-strong);
}

.qty-row {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  gap: 8px;
  align-items: center;
}

.qty-btn {
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
}

.qty-btn:hover {
  border-color: var(--border-strong);
}

.qty-input {
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-align: center;
  font-size: 14px;
  font-family: var(--font);
  -moz-appearance: textfield;
}

.qty-input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

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

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

.product-stock {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.product-stock.low {
  color: rgba(251, 191, 36, 0.9);
}

.product-stock.ok {
  color: rgba(134, 239, 172, 0.85);
}

.product-add-btn {
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: color 0.4s var(--ease), border-color 0.4s, transform 0.4s var(--ease);
}

.product-add-btn:hover:not(:disabled) {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.38);
  transform: translateY(-1px);
}

.product-add-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.product-aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.product-meta-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}

.meta-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 10px;
}

.size-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.size-pill {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 12px;
  color: var(--muted);
}

.size-pill.active {
  border-color: rgba(168, 85, 247, 0.45);
  color: rgba(233, 213, 255, 0.95);
  background: rgba(88, 28, 135, 0.22);
}

.product-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  white-space: pre-wrap;
}

.product-desc.is-empty {
  font-style: italic;
  color: var(--faint);
}

body.is-product-view .toolbar,
body.is-product-view .cat-bar {
  display: none;
}

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

}

@media (prefers-reduced-motion: reduce) {
  .card,
  .card-reveal,
  .reveal,
  .page-card,
  .cat-btn.active::after,
  .backdrop,
  .drawer,
  .product-view,
  #browseView > .home-view,
  #browseView > .grid {
    animation: none !important;
    transition: none !important;
  }

  .card,
  .card-reveal,
  .reveal,
  .page-card,
  .home-tld-wait,
  .home-lead-wait,
  .home-stats-wait,
  .home-stat {
    opacity: 1 !important;
    transform: none !important;
  }

  .type-cursor::after {
    display: none;
  }
}
