/* ==========================================================================
   011 KaiLionCrafts — Prism
   Design Tokens & Modern Component Styling
   Compliant with KaiLionCrafts Brand Standards & Acceptance Checklist
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens & Root Variables
   -------------------------------------------------------------------------- */
:root {
  /* Brand Palette — Prism Violet & Morning Champagne */
  --primary: #5432a8;
  --primary-hover: #43248c;
  --primary-light: #7048dc;
  --primary-surface: #f4effc;
  --primary-pale: #faf7fe;
  --primary-glow: rgba(84, 50, 168, 0.14);

  --accent: #d97706;
  --accent-hover: #b45309;
  --accent-light: #fef3c7;
  --accent-glow: rgba(217, 119, 6, 0.16);

  /* Typography Colors — High Contrast, Clean Ink */
  --ink: #1b1429;
  --ink-secondary: #3b324c;
  --muted: #5c536e;
  --subtle: #857c96;

  /* Surfaces & Backgrounds — Clear White Base */
  --bg-page: #ffffff;
  --surface: #faf8fd;
  --surface-card: #ffffff;
  --surface-hover: #f7f3fc;
  --surface-strong: #f3eefb;

  /* Lines & Borders */
  --line: #e7e1f2;
  --line-light: #f2edf8;
  --line-focus: #7048dc;

  /* Shadows */
  --shadow-xs: 0 1px 3px rgba(27, 20, 41, 0.04);
  --shadow-sm: 0 3px 10px rgba(27, 20, 41, 0.05);
  --shadow-md: 0 8px 24px rgba(27, 20, 41, 0.08);
  --shadow-lg: 0 16px 36px rgba(27, 20, 41, 0.12);
  --shadow-hover: 0 18px 40px rgba(84, 50, 168, 0.12);

  /* Typography Families */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, Cambria, "Times New Roman", serif;

  /* Radius */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --transition-fast: 180ms ease-out;
  --transition-normal: 320ms var(--ease);
  --transition-smooth: 520ms var(--ease);

  /* Minimum touch target for touch ergonomics */
  --touch-target: 44px;
}

/* --------------------------------------------------------------------------
   2. Reset & Global Base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--bg-page);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

button, a {
  touch-action: manipulation;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

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

h1, h2, h3, h4, p, dl, dd {
  margin-top: 0;
}

h1, h2, h3 {
  font-weight: 500;
  letter-spacing: -0.04em;
  color: var(--ink);
}

em {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
}

h1 {
  font-size: clamp(2.8rem, 5.5vw, 5.6rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

h2 {
  font-size: clamp(2rem, 3.8vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  line-height: 1.25;
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.8rem;
}

.wrap {
  width: min(1440px, 92%);
  margin-inline: auto;
}

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

/* --------------------------------------------------------------------------
   3. Header & Navigation (Desktop & Mobile Drawer)
   -------------------------------------------------------------------------- */
#header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-light);
  transition: box-shadow var(--transition-normal);
}

.nav {
  width: min(1440px, 92%);
  margin: auto;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  white-space: nowrap;
}

.logo img {
  width: 52px;
  height: 46px;
  object-fit: contain;
}

.logo-wordmark {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.logo:hover .logo-wordmark {
  color: var(--primary);
}

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

.nav nav a {
  position: relative;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-secondary);
  padding: 0.5rem 0;
}

.nav nav a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition-fast);
}

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

.nav nav a:hover::after,
.nav nav a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

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

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

.search-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.35rem;
  color: var(--muted);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.search-icon:hover {
  background: var(--primary-surface);
  color: var(--primary);
}

.selection-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  background: var(--primary-surface);
  border: 1px solid var(--line);
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.selection-link:hover {
  background: var(--surface-strong);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.selection-link span[data-count] {
  display: inline-grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.selection-link.pop span[data-count] {
  transform: scale(1.3);
}

#menu {
  display: none;
  width: var(--touch-target);
  height: var(--touch-target);
  font-size: 1.3rem;
  color: var(--ink);
  border-radius: var(--radius-sm);
  place-items: center;
  border: 1px solid var(--line-light);
  background: var(--surface);
  transition: background var(--transition-fast);
}

#menu:hover {
  background: var(--primary-surface);
  color: var(--primary);
}

/* No-JS Navigation fallback */
.nojs-nav {
  display: flex;
  gap: 1.5rem;
  padding: 0.5rem 4% 0.8rem;
  font-size: 0.85rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.nojs-nav a {
  font-weight: 600;
  color: var(--primary);
}

/* --------------------------------------------------------------------------
   4. Buttons & Pills Components
   -------------------------------------------------------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  min-height: 48px;
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius-full);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
}

.pill:hover {
  transform: translateY(-2px);
}

.pill.dark {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.pill.dark:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 18px var(--primary-glow);
}

.pill.outline {
  background: transparent;
  border-color: var(--line);
  color: var(--primary);
}

.pill.outline:hover {
  background: var(--primary-surface);
  border-color: var(--primary);
}

.pill.light {
  background: #ffffff;
  color: var(--primary);
  border-color: var(--line);
}

.pill.light:hover {
  background: var(--primary-surface);
  color: var(--primary-hover);
  border-color: var(--primary);
}

.pill.gold {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.pill.gold:hover {
  background: var(--accent-hover);
}

/* --------------------------------------------------------------------------
   5. Home: Chapter Stage & Refractive Portals
   -------------------------------------------------------------------------- */
.chapter-header {
  width: min(1440px, 92%);
  margin: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  padding: 3rem 0 1.8rem;
}

.chapter-header .eyebrow {
  margin-bottom: 0.5rem;
}

.chapter-header h1 {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 3.8rem);
  line-height: 1.06;
}

.chapter-instruction {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  line-height: 1.8;
  font-weight: 700;
  text-align: right;
  color: var(--subtle);
}

.chapter-instruction span {
  color: var(--primary);
  display: block;
}

/* Portal Grid */
.panels {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: min(1440px, 92%);
  margin: auto;
  padding: 0;
  height: clamp(520px, calc(100svh - 220px), 820px);
}

.portal {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
  outline-offset: -3px;
  isolation: isolate;
}

.portal:hover,
.portal:focus-visible {
  border-color: var(--primary);
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}

/* Refractive Prism Sheen Effect */
.portal-art {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: radial-gradient(circle at 50% 35%, rgba(255,255,255,0.9) 0%, rgba(246, 241, 252, 0.45) 85%);
}

.portal-art::before {
  content: "";
  position: absolute;
  inset: -10% -20% 0;
  background: linear-gradient(135deg, rgba(112, 72, 220, 0.08) 0%, rgba(217, 119, 6, 0.08) 48%, rgba(84, 50, 168, 0.06) 100%);
  opacity: 0.7;
  transition: opacity var(--transition-normal), transform var(--transition-smooth);
}

.portal:hover .portal-art::before {
  opacity: 1;
  transform: scale(1.1) rotate(2deg);
}

/* Subtle glass floor line */
.portal-art::after {
  content: "";
  position: absolute;
  bottom: 24%;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
  opacity: 0.6;
}

.portal-art img {
  position: absolute;
  top: 46%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  height: 90%;
  object-fit: contain;
  transition: transform var(--transition-smooth);
  will-change: transform;
}

.portal:hover .portal-art img {
  transform: translate(-50%, -53%) scale(1.05);
}

/* Portal Information */
.portal-top {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1.4rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--subtle);
}

.portal-top span:first-child {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  letter-spacing: 0;
  color: var(--primary);
}

.portal-title {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 1.6rem 1.4rem;
  background: linear-gradient(to top, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.7) 65%, transparent 100%);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-top: 1px solid rgba(231, 225, 242, 0.4);
}

.portal-title small {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--subtle);
  margin-bottom: 0.2rem;
}

.portal-title h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 2.8vw, 3rem);
  margin: 0.2rem 0;
  color: var(--ink);
}

.portal-dot {
  color: var(--accent);
}

.portal-title p {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
}

.portal-arrow {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  flex: none;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.portal:hover .portal-arrow {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: rotate(45deg);
}

/* Chapter Bottom Bar */
.chapter-bottom {
  width: min(1440px, 92%);
  margin: auto;
  display: flex;
  justify-content: space-between;
  padding: 1.2rem 0 2rem;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--subtle);
}

.chapter-bottom .mobile-hint {
  display: none;
  color: var(--primary);
}

/* --------------------------------------------------------------------------
   6. Home: Feature & Split-Links Sections
   -------------------------------------------------------------------------- */
.feature {
  padding: 6.5rem 0;
  background: var(--surface);
  border-top: 1px solid var(--line-light);
  border-bottom: 1px solid var(--line-light);
}

.feature .wrap {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  align-items: center;
  gap: clamp(3rem, 7vw, 6rem);
}

.feature-copy {
  max-width: 480px;
}

.feature-copy h2 {
  margin-bottom: 1.2rem;
}

.feature-copy p:not(.eyebrow) {
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

.feature-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--line);
}

.feature-image img {
  width: 100%;
  height: 520px;
  object-fit: cover;
  transition: transform var(--transition-smooth);
}

.feature-image:hover img {
  transform: scale(1.03);
}

.split-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
}

.split-links a {
  padding: clamp(4rem, 6vw, 6rem) 6%;
  border-right: 1px solid var(--line);
  background: #ffffff;
  transition: background var(--transition-fast);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 340px;
}

.split-links a:last-child {
  border-right: none;
}

.split-links a:hover {
  background: var(--surface);
}

.split-links small {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--subtle);
}

.split-links h2 {
  margin: 1.5rem 0;
  color: var(--ink);
}

.split-links span {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.split-links a:hover span {
  color: var(--primary-hover);
}

/* --------------------------------------------------------------------------
   7. Shop / Collection View
   -------------------------------------------------------------------------- */
.page-heading {
  padding: 4rem 0 2rem;
  max-width: 900px;
}

.page-heading h1 {
  margin: 0.8rem 0 1rem;
}

.page-heading p:last-child {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 680px;
}

/* Category Filter Pills */
.category-pills {
  display: flex;
  gap: 0.6rem;
  padding: 0.5rem 0 1.5rem;
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.cat-pill {
  min-height: var(--touch-target);
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-secondary);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.cat-pill:hover {
  background: var(--surface-strong);
  border-color: var(--primary);
  color: var(--primary);
}

.cat-pill.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 3px 10px var(--primary-glow);
}

/* Shop Layout (Desktop Rail + Grid) */
@media(min-width: 861px) {
  .shop {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    column-gap: clamp(2.5rem, 5vw, 5rem);
  }
  .shop > .page-heading {
    grid-column: 1 / -1;
    border-bottom: 1px solid var(--line);
    padding-bottom: 2.5rem;
  }
  .shop > .category-pills {
    grid-column: 1 / -1;
    border-bottom: 1px solid var(--line-light);
    margin-bottom: 2rem;
  }
  .shop > .filters {
    grid-column: 1;
    grid-row: 3 / span 3;
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
    border-right: 1px solid var(--line);
    padding: 0.5rem 1.5rem 2rem 0;
  }
  .shop > .resultbar,
  .shop > #grid,
  .shop > #empty {
    grid-column: 2;
  }
  .shop > #grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Filters Component */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  align-items: flex-end;
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  width: 100%;
}

.filters input,
.filters select {
  width: 100%;
  min-height: var(--touch-target);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  font-size: 0.9rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.filters input:focus,
.filters select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-surface);
}

.text-button {
  min-height: var(--touch-target);
  display: inline-flex;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: underline;
  padding: 0.4rem 0;
}

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

/* Result Bar */
.resultbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0 1rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--subtle);
  border-bottom: 1px solid var(--line-light);
  margin-bottom: 2rem;
}

.resultbar span:first-child {
  color: var(--primary);
}

/* Product Card Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.4rem 1.6rem;
}

.card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface-card);
  border: 1px solid var(--line-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  padding: 0.8rem;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--line);
  box-shadow: var(--shadow-md);
}

.card-img {
  position: relative;
  display: block;
  aspect-ratio: 1;
  background: var(--surface);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.card-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity var(--transition-normal), transform var(--transition-smooth);
}

.card-img .scene {
  opacity: 0;
  object-fit: cover;
}

/* Image-only Hover Swapping, strictly adhering to Acceptance Criteria #13 */
.card-img:hover .scene {
  opacity: 1;
  transform: scale(1.04);
}

.card-arrow {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  box-shadow: var(--shadow-xs);
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.card:hover .card-arrow {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: rotate(45deg);
}

/* Card Information Alignment */
.card-info {
  min-width: 0;
  flex: 1;
  display: grid;
  grid-template-rows: 1.4rem 2.8rem 2.4rem auto;
  row-gap: 0.4rem;
  align-content: start;
  padding: 1rem 0.4rem 0.2rem;
}

.card-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--primary);
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-info h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.3;
  max-height: 2.8rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
  color: var(--ink);
}

.card-info h3 a:hover {
  color: var(--primary);
}

.card-info p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
  max-height: 2.4rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
}

/* Quick Add Button */
.quick {
  align-self: end;
  min-height: var(--touch-target);
  padding: 0.6rem 0.8rem;
  margin-top: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.quick:hover {
  background: var(--primary-surface);
  border-color: var(--primary);
  color: var(--primary-hover);
  transform: translateY(-1px);
}

.quick.added {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

/* Empty State */
.empty {
  padding: 5rem 0;
  text-align: center;
  color: var(--muted);
  font-size: 1.1rem;
}

/* --------------------------------------------------------------------------
   8. Product Detail View & Gallery Stage
   -------------------------------------------------------------------------- */
.crumb {
  padding: 1.8rem 0 1rem;
  color: var(--subtle);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.crumb a {
  color: var(--primary);
  font-weight: 600;
}

.product-heading {
  padding: 0.5rem 0 2rem;
  max-width: 1000px;
}

.product-heading .eyebrow {
  margin-bottom: 0.6rem;
}

.product-heading h1 {
  font-size: clamp(2.2rem, 3.8vw, 3.8rem);
  line-height: 1.08;
  margin: 0;
  overflow-wrap: anywhere;
}

.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.9fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
  margin-bottom: 5rem;
}

/* Gallery Stage */
.product-visual {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1rem, 2vw, 1.8rem);
  box-shadow: var(--shadow-sm);
}

.gallery-stage {
  position: relative;
  overflow: hidden;
  background: #ffffff;
  border-radius: var(--radius-md);
  aspect-ratio: 1.45;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-stage #main-image {
  width: 92%;
  height: 92%;
  object-fit: contain;
}

/* Touch-compliant Gallery Navigation Arrows (>= 44x44px) */
.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: var(--touch-target);
  height: var(--touch-target);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 1.2rem;
  box-shadow: var(--shadow-sm);
  opacity: 0.85;
  transition: opacity var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.gallery-arrow:hover {
  opacity: 1;
  background: #ffffff;
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-50%) scale(1.05);
}

.gallery-prev {
  left: 14px;
}

.gallery-next {
  right: 14px;
}

/* Precision Magnifier */
.gallery-magnifier {
  display: none;
  position: absolute;
  z-index: 10;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 8px 30px rgba(84, 50, 168, 0.25);
  background-repeat: no-repeat;
  background-color: #ffffff;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.gallery-zoom-hint {
  display: none;
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 5;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  pointer-events: none;
}

@media(hover: hover) and (pointer: fine) {
  .gallery-stage {
    cursor: crosshair;
  }
  .gallery-magnifier.is-visible {
    display: block;
  }
  .gallery-zoom-hint {
    display: block;
  }
}

/* Gallery Thumbnails Strip */
.gallery-thumbnails {
  display: flex;
  gap: 12px;
  padding-top: 14px;
  overflow-x: auto;
}

.gallery-thumb {
  width: 72px;
  height: 72px;
  flex: none;
  padding: 4px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gallery-thumb[aria-pressed="true"] {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-surface), inset 0 0 0 1px var(--primary);
}

.gallery-thumb:hover {
  border-color: var(--primary-light);
}

/* Product Information & Purchase Area */
.product-info {
  display: flex;
  flex-direction: column;
}

.product-info > p:not(.eyebrow):not(#feedback) {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: 2rem;
}

/* Specifications Table */
.product-info dl {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.5rem 1.4rem;
  margin: 0 0 2rem;
}

.product-info dl div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line-light);
  font-size: 0.88rem;
}

.product-info dl div:last-child {
  border-bottom: none;
}

.product-info dl dt {
  color: var(--muted);
  font-weight: 500;
}

.product-info dl dd {
  color: var(--ink);
  font-weight: 600;
  margin: 0;
  text-align: right;
}

/* Stepper Quantity Control Component */
.quantity-control-group {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.quantity-control-group label {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  overflow: hidden;
}

.stepper button {
  width: var(--touch-target);
  height: var(--touch-target);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  color: var(--ink);
  background: var(--surface);
  transition: background var(--transition-fast), color var(--transition-fast);
}

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

.stepper input {
  width: 58px;
  height: var(--touch-target);
  padding: 0;
  border: none;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  -moz-appearance: textfield;
}

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

.stepper input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

/* Actions */
.product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: center;
}

#feedback {
  min-height: 1.5rem;
  margin-top: 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary);
}

/* Related Products */
.related {
  padding: 5rem 0 3rem;
  border-top: 1px solid var(--line-light);
}

.related h2 {
  margin-bottom: 2.5rem;
}

/* --------------------------------------------------------------------------
   9. Editorial Pages: Story, Care & Journal
   -------------------------------------------------------------------------- */
.story-hero {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  align-items: center;
  gap: clamp(3rem, 7vw, 6rem);
  padding: 5rem 0;
}

.story-hero img {
  width: 100%;
  aspect-ratio: 1.25;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

.story-copy {
  padding: 5rem 0 7rem;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  border-top: 1px solid var(--line);
}

.story-copy div {
  max-width: 720px;
}

.story-copy p {
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 1.8rem;
}

/* Care List */
.care-list {
  padding: 2rem 0 7rem;
}

.care-list article {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 2rem;
  padding: 3rem 0;
  border-top: 1px solid var(--line);
}

.care-list article > span {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  color: var(--primary);
  font-weight: 400;
}

.care-list article h2 {
  font-size: 2rem;
  margin-bottom: 0.8rem;
}

.care-list article p {
  font-size: 1.1rem;
  line-height: 1.75;
  color: var(--muted);
  max-width: 680px;
}

/* Journal List */
.journal-list {
  padding-bottom: 7rem;
}

.journal-list article {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  align-items: center;
  gap: clamp(3rem, 6vw, 5rem);
  padding: 4.5rem 0;
  border-top: 1px solid var(--line);
}

.journal-list article:nth-child(even) img {
  order: 2;
}

.journal-list img {
  width: 100%;
  aspect-ratio: 1.3;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.journal-list article h2 {
  font-size: clamp(2rem, 3.2vw, 3.2rem);
  margin-bottom: 1rem;
}

.journal-list article p:not(.eyebrow) {
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--muted);
  margin-bottom: 1.8rem;
}

/* --------------------------------------------------------------------------
   10. Footer Component (High Compliance with Brand Guidelines)
   -------------------------------------------------------------------------- */
.footer-top {
  padding: 6.5rem 0 5rem;
  background: #181224;
  color: #ffffff;
}

.footer-top .wrap {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: clamp(3rem, 6vw, 6rem);
}

.footer-hero h2 {
  color: #ffffff;
  font-size: clamp(2.2rem, 3.8vw, 3.6rem);
  margin: 0.8rem 0 1.8rem;
}

.footer-links {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 2.5rem;
}

.footer-links h3 {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: #d1bbf8;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}

.footer-links a,
.footer-links p {
  display: block;
  font-size: 0.88rem;
  line-height: 1.8;
  margin: 0.6rem 0;
  color: #e4ddf0;
}

.footer-links a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-bottom {
  background: #181224;
  color: #a89bb8;
  border-top: 1px solid #322646;
  padding: 1.8rem 0;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.footer-bottom .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.2rem;
}

.footer-bottom a {
  color: #e4ddf0;
}

.footer-bottom a:hover {
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   11. Portal Transitions
   -------------------------------------------------------------------------- */
.chapter-transition-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  will-change: clip-path;
}

.chapter-transition-focus {
  overflow: hidden !important;
  isolation: isolate;
  transform-origin: center;
  transition: none !important;
  border: 0 !important;
}

.transitioning .panels {
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   12. Responsive Breakpoints & Touch Optimization
   -------------------------------------------------------------------------- */
@media(max-width: 1024px) {
  .panels {
    height: clamp(480px, 60vh, 720px);
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media(max-width: 860px) {
  .nav {
    height: 72px;
  }
  .logo img {
    width: 44px;
    height: 38px;
  }
  #menu {
    display: grid;
  }
  .nav-right .search-icon {
    display: none;
  }
  
  /* Mobile Navigation Drawer */
  .nav nav {
    display: none;
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    flex-direction: column;
    align-items: stretch;
    padding: 2rem 6%;
    gap: 0;
    z-index: 99;
    overflow-y: auto;
    border-top: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
  }
  
  .nav nav.open {
    display: flex;
    animation: drawerFadeIn 0.25s var(--ease);
  }
  
  .nav nav a {
    font-size: 1.25rem;
    padding: 1.2rem 0;
    border-bottom: 1px solid var(--line-light);
    color: var(--ink);
  }
  
  .nav nav a::after {
    display: none;
  }

  /* Mobile Portals Horizontal Carousel */
  .chapter-header {
    padding: 1.6rem 0 1.2rem;
    align-items: flex-start;
  }
  .chapter-instruction {
    display: none;
  }
  .panels {
    display: flex;
    width: 100%;
    height: calc(100svh - 220px);
    min-height: 480px;
    max-height: 680px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    padding: 0 4%;
    gap: 12px;
    scrollbar-width: none;
  }
  .panels::-webkit-scrollbar {
    display: none;
  }
  .portal {
    flex: 0 0 min(82vw, 360px);
    scroll-snap-align: center;
  }
  .chapter-bottom .mobile-hint {
    display: inline;
  }
  .chapter-bottom span:nth-child(2) {
    display: none;
  }

  /* Sections */
  .feature .wrap,
  .story-hero,
  .story-copy,
  .journal-list article,
  .product-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .feature-image img {
    height: auto;
    aspect-ratio: 1.2;
  }
  .split-links {
    grid-template-columns: 1fr;
  }
  .split-links a {
    border-right: none;
    border-bottom: 1px solid var(--line);
    min-height: 260px;
  }
  .footer-top .wrap {
    grid-template-columns: 1fr;
    gap: 3.5rem;
  }
  .footer-links {
    grid-template-columns: 1fr 1fr;
  }
  .gallery-stage {
    aspect-ratio: 1.15;
  }
  .journal-list article:nth-child(even) img {
    order: 0;
  }
}

@media(max-width: 540px) {
  .grid {
    grid-template-columns: 1fr;
    gap: 1.8rem;
  }
  .portal {
    flex-basis: 88vw;
  }
  .footer-links {
    grid-template-columns: 1fr;
  }
  .selection-link {
    padding: 0.4rem 0.75rem;
  }
  .selection-link span[data-count] {
    font-size: 0.7rem;
  }
  .care-list article {
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 1.2rem;
  }
  .care-list article > span {
    font-size: 1.8rem;
  }
}

@keyframes drawerFadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   13. Reduced Motion Media Query
   -------------------------------------------------------------------------- */
@media(prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .portal-art img,
  .portal-arrow,
  .portal-art::before {
    transition: none !important;
  }
}
