/* ==========================================================================
   OrchestraVault — Global Design System (based on DESIGN.md)
   This is the SINGLE source of truth for all CSS variables and base styles.
   ========================================================================== */

/* ==========================================================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ========================================================================== */
:root {
  /* Brand Colors (DESIGN.md §2) */
  --c-main: #639fab;          /* Blue Tone — primary accent */
  --c-main-hover: #4e828d;

  /* Structural Colors (DESIGN.md §2) */
  --c-ink: #161616;           /* Text ink */
  --c-canvas: #ffffff;        /* Page background */
  --c-canvas-alt: #f0f0f0;    /* Alternate surface */
  --c-muted: #8a8a8a;         /* Secondary text */
  --c-dark-neutral: #444444;
  --c-mid-neutral: #dddddd;
  --c-dark-surface: #000000;

  /* Neutral Scale (tailwind.css tokens) */
  --color-neutral-25: #fcfcfc;
  --color-neutral-50: #f5f5f5;
  --color-neutral-100: #ebebeb;
  --color-neutral-200: #dedede;
  --color-neutral-300: #c7c7c7;
  --color-neutral-400: #ababab;
  --color-neutral-500: #898989;
  --color-neutral-600: #696969;
  --color-neutral-700: #4d4d4d;
  --color-neutral-800: #333333;
  --color-neutral-900: #1b1b1b;
  --color-neutral-950: #070707;
  --color-primary: #639fab;

  /* Semantic Aliases */
  --bg-main: var(--c-canvas);
  --bg-card: var(--c-canvas);
  --text-primary: var(--c-ink);
  --text-secondary: var(--c-muted);
  --text-muted: var(--c-muted);
  --border-color: var(--color-neutral-100);

  /* Legacy aliases (used by detail.css) */
  --primary: var(--c-main);
  --campaign-bg-1: var(--c-canvas);
  --dark-surface: #000000;
  --dark-neutral: var(--color-neutral-200);
  --ink: var(--c-ink);
  --canvas: var(--c-canvas);

  /* Typography (DESIGN.md §3) */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Courier New', Courier, monospace;

  /* Type Scale */
  --text-display-xxl: 58px;
  --lh-display-xxl: 62px;
  --text-display-md: 32px;
  --lh-display-md: 34px;
  --text-heading-md: 20px;
  --lh-heading-md: 25px;
  --text-body-lg: 22px;
  --lh-body-lg: 30px;
  --text-body-md: 15px;
  --lh-body-md: 23px;
  --text-body-sm: 13px;
  --lh-body-sm: 20px;
  --text-overline: 14px;
  --lh-overline: 18px;
  --text-caption: 12px;
  --lh-caption: 18px;

  /* Spacing (DESIGN.md §5 — base unit 4px) */
  --space-unit: 4px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Layout */
  --max-width: 1316px;
  --content-padding: 24px;
  --grid-gap: 16px;

  /* Navigation */
  --nav-height: 64px;
  --nav-container-width: 1316px;
  --nav-gutter: 24px;
  --nav-brand-width: 260px;
  --nav-actions-width: 408px;
  --nav-logo-size: 32px;
  --nav-search-width: 360px;
  --nav-search-height: 36px;

  /* Motion (DESIGN.md §6.5) */
  --duration-sm: 100ms;
  --duration-md: 300ms;
  --duration-lg: 650ms;
  --easing: ease;

  /* Border Radius (DESIGN.md §5) */
  --radius-sm: 2px;
  --radius-md: 6px;
  --radius-full: 9999px;

  /* Shadows (DESIGN.md §6) */
  --shadow-sm: rgba(0, 0, 0, 0.02) 0px 3px 4px 0px;
  --shadow-md: rgba(0, 0, 0, 0.16) 0px 2px 7px -4px;
}

/* ==========================================================================
   BASE RESET & BODY
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background-color: var(--c-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-body-md);
  font-weight: 400;
  line-height: var(--lh-body-md);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color 0.25s ease-in-out; }
a:hover { color: var(--c-main); }

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  min-height: var(--nav-height);
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-neutral-100);
}

.site-nav {
  width: min(100%, var(--nav-container-width));
  max-width: var(--nav-container-width);
  height: var(--nav-height);
  min-height: var(--nav-height);
  margin: 0 auto;
  padding: 0 var(--nav-gutter);
  display: grid;
  grid-template-columns: var(--nav-brand-width) minmax(0, 1fr) var(--nav-actions-width);
  align-items: center;
  column-gap: 24px;
  position: relative;
}

.nav-logo {
  display: flex;
  align-items: center;
  width: var(--nav-brand-width);
  height: var(--nav-height);
  min-width: 0;
  gap: 0.75rem;
  color: var(--color-neutral-950);
  text-decoration: none;
  transition: color 0.3s;
}
.nav-logo:hover { color: var(--c-main); }
.nav-logo svg {
  width: var(--nav-logo-size);
  height: var(--nav-logo-size);
  flex: 0 0 var(--nav-logo-size);
  fill: none;
}
.nav-logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: inherit;
}

.nav-links {
  display: none;
  align-items: center;
  justify-self: center;
  gap: 2.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 768px) { .nav-links { display: flex; } }
.nav-links a {
  display: inline-flex;
  align-items: center;
  height: var(--nav-height);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-neutral-600);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding-top: 2px;
  transition: color 0.3s;
}
.nav-links a:hover { color: var(--color-neutral-950); }
.nav-links a.active { font-weight: 700; color: var(--color-neutral-950); border-bottom-color: var(--c-main); }

.nav-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  width: var(--nav-actions-width);
  min-width: var(--nav-actions-width);
  gap: 1.5rem;
}

.nav-search { position: relative; width: var(--nav-search-width); display: none; }
@media (min-width: 640px) { .nav-search { display: block; } }
.nav-search-icon { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); width: 1rem; height: 1rem; color: var(--color-neutral-400); }
.nav-search-input {
  width: 100%;
  height: var(--nav-search-height);
  background-color: var(--color-neutral-50);
  color: var(--color-neutral-900);
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-full);
  padding: 0.5rem 2rem 0.5rem 2.25rem;
  font-size: 13px;
  line-height: 1;
  transition: all 0.3s;
  outline: none;
}
.nav-search-input:focus { border-color: var(--c-main); }
.nav-search-clear { position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--color-neutral-400); background: transparent; border: none; cursor: pointer; display: none; }
.nav-search-clear:hover { color: var(--color-neutral-950); }
.search-dropdown { position: absolute; top: 100%; left: 0; width: 100%; background-color: white; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); border: 1px solid var(--color-neutral-100); border-radius: 4px; margin-top: 0.5rem; display: none; z-index: 200; }

.nav-hamburger { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.375rem; width: 40px; height: 40px; padding: 0; background: transparent; border: none; cursor: pointer; }
@media (min-width: 768px) { .nav-hamburger { display: none; } }
.nav-hamburger span { display: block; width: 1.5rem; height: 2px; background-color: var(--color-neutral-900); }

@media (max-width: 767px) {
  :root { --nav-height: 56px; --nav-gutter: 16px; }
  header { height: var(--nav-height); min-height: var(--nav-height); }
  .site-nav { grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 12px; height: var(--nav-height); min-height: var(--nav-height); padding: 0 var(--nav-gutter); }
  .nav-logo { width: auto; max-width: min(56vw, 260px); height: var(--nav-height); }
  .nav-search { display: none; }
  .nav-right { width: auto; min-width: 0; justify-self: end; gap: 12px; }
  .nav-hamburger { display: flex; justify-self: end; }
}

/* Mobile Menu */
.mobile-menu { display: none; background-color: var(--color-neutral-50); border-bottom: 1px solid var(--color-neutral-100); padding: 1rem 1.5rem; }
.mobile-menu.open { display: block; }
.mobile-menu-links { display: flex; flex-direction: column; gap: 1rem; list-style: none; padding: 0; margin: 0; }
.mobile-menu-links a { display: block; color: var(--color-neutral-900); font-weight: 700; font-size: 15px; text-decoration: none; }

/* ==========================================================================
   BREADCRUMB
   ========================================================================== */
.seo-breadcrumb,
.breadcrumb {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px var(--content-padding);
  font-size: var(--text-caption);
  line-height: var(--lh-caption);
  color: var(--c-muted);
}
.seo-breadcrumb a,
.breadcrumb a {
  color: var(--c-main);
  text-decoration: none;
  transition: color 0.25s;
}
.seo-breadcrumb a:hover,
.breadcrumb a:hover {
  color: var(--c-main-hover);
}

/* ==========================================================================
   HOMEPAGE — PRODUCT GRID & CARDS
   ========================================================================== */
#main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px var(--content-padding);
}

.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 640px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }

.product-card {
  background: var(--c-canvas);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-neutral-100);
  transition: all 0.3s ease;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  color: inherit;
}
.product-card:hover {
  box-shadow: 0 12px 32px -8px rgba(0,0,0,0.12);
  transform: translateY(-4px);
  color: inherit;
}

.product-card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: linear-gradient(145deg, #1a1a1a 0%, #2a2a2a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-card-image img {
  width: 75%;
  height: auto;
  max-height: 85%;
  object-fit: contain;
  transition: transform 0.5s ease;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.4));
}
.product-card:hover .product-card-image img { transform: scale(1.04); }

/* Bundle multi-image: fan/overlap layout */
.product-card-image.multi-image {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: linear-gradient(145deg, #f2f2f2 0%, #e8e8e8 100%);
}
.product-card-image.multi-image img {
  position: absolute;
  width: auto;
  height: 72%;
  max-width: none;
  object-fit: contain;
  filter: drop-shadow(0 6px 20px rgba(0,0,0,0.25));
  border-radius: 4px;
  transition: transform 0.5s ease;
}
/* 2-image layout */
.product-card-image.multi-image img:first-child:nth-last-child(2) {
  left: 12%; transform: rotate(-6deg);
}
.product-card-image.multi-image img:last-child:nth-child(2) {
  right: 12%; transform: rotate(4deg);
}
.product-card:hover .product-card-image.multi-image img:first-child:nth-last-child(2) {
  transform: rotate(-8deg) translateY(-4px) scale(1.03);
}
.product-card:hover .product-card-image.multi-image img:last-child:nth-child(2) {
  transform: rotate(6deg) translateY(-4px) scale(1.03);
}
/* 3-image layout */
.product-card-image.multi-image img:first-child:nth-last-child(3) {
  left: 6%; transform: rotate(-8deg) translateY(4%); z-index: 1;
}
.product-card-image.multi-image img:nth-child(2):nth-last-child(2) {
  z-index: 2; transform: translateY(-2%) scale(1.05);
}
.product-card-image.multi-image img:last-child:nth-child(3) {
  right: 6%; transform: rotate(8deg) translateY(4%); z-index: 1;
}
.product-card:hover .product-card-image.multi-image img:first-child:nth-last-child(3) {
  transform: rotate(-10deg) translateY(-2%) scale(1.04);
}
.product-card:hover .product-card-image.multi-image img:nth-child(2):nth-last-child(2) {
  transform: translateY(-5%) scale(1.08);
}
.product-card:hover .product-card-image.multi-image img:last-child:nth-child(3) {
  transform: rotate(10deg) translateY(-2%) scale(1.04);
}
/* 4-image layout */
.product-card-image.multi-image img:first-child:nth-last-child(4) {
  left: 2%; transform: rotate(-10deg) translateY(6%); z-index: 1; height: 60%;
}
.product-card-image.multi-image img:nth-child(2):nth-last-child(3) {
  left: 22%; z-index: 2; transform: rotate(-3deg) translateY(-2%); height: 68%;
}
.product-card-image.multi-image img:nth-child(3):nth-last-child(2) {
  right: 22%; z-index: 2; transform: rotate(3deg) translateY(-2%); height: 68%;
}
.product-card-image.multi-image img:last-child:nth-child(4) {
  right: 2%; transform: rotate(10deg) translateY(6%); z-index: 1; height: 60%;
}

.product-card-body {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.product-card-series {
  font-size: var(--text-caption);
  font-weight: 600;
  color: var(--c-main);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.product-card-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.35;
  color: var(--c-ink);
}
.product-card-subtitle {
  font-size: var(--text-body-sm);
  color: var(--c-muted);
  margin: 0 0 12px;
}
.product-card-desc {
  font-size: var(--text-body-sm);
  color: var(--color-neutral-600);
  line-height: 1.5;
  margin: 0 0 16px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--color-neutral-100);
}
.product-card-price,
.product-price {
  font-weight: 700;
  color: var(--c-ink);
  font-size: 15px;
}
.product-card-price-strike {
  font-size: 12px;
  color: var(--c-muted);
  text-decoration: line-through;
  margin-right: 8px;
}
.product-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-body-sm);
  font-weight: 600;
  color: var(--c-main);
  transition: color 0.25s;
}
.product-card-btn svg { width: 20px; height: 20px; }
.product-card:hover .product-card-btn { color: var(--c-main-hover); }

/* ==========================================================================
   FOOTER (DESIGN.md §4 Footer)
   ========================================================================== */
footer,
.site-footer {
  background-color: #0f0f11;
  color: #c0c0c0;
  font-size: 14px;
  padding: 48px var(--content-padding);
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ==========================================================================
   BUTTONS (DESIGN.md §4 Button variants)
   ========================================================================== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 20px;
  background-color: var(--c-main);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s ease-in-out;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.btn-primary:hover {
  background-color: var(--c-main-hover);
  color: #fff;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 14px;
  background-color: transparent;
  color: var(--c-main);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s ease-in-out;
}
.btn-secondary:hover {
  border-color: var(--c-main);
  color: var(--c-main);
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */
.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;
}
