/* ==========================================================================
   FABRITOR SOURCING LIMITED (FSL)
   Master Design System & Core Stylesheet
   Architecture: Editorial Light / Dark Balance & Milanese Quiet Luxury
   Official Global Sourcing Agent for Yegof & Carvico Grade Textiles
   ========================================================================== */


:root {
  /* Editorial Light Mode (Default) */
  --bg-primary: #FAF9F6;
  --bg-secondary: #F3F1EC;
  --bg-surface: #FFFFFF;
  --bg-surface-elevated: #F8F7F4;
  --bg-card: #FFFFFF;
  --bg-dark-section: #0E131C;
  --bg-dark-card: #151C28;

  /* Typography Colors (Light) */
  --text-primary: #12161E;
  --text-secondary: #4A5568;
  --text-muted: #718096;
  --text-on-dark: #F4F2EC;
  --text-on-dark-muted: #9DA8BA;

  /* Brand Accents - Extracted & Calibrated from Logo Dot */
  --copper-dot: #E26214;
  --copper-light: #F47528;
  --copper-hover: #C5530B;
  --copper-dim: rgba(226, 98, 20, 0.12);
  --copper-glow: rgba(226, 98, 20, 0.35);
  --gold-primary: #D4AF37;
  --gold-light: #E5C358;
  --gold-dim: rgba(212, 175, 55, 0.12);
  --brand-orange: #E26214;
  --brand-orange-light: #F47528;
  --brand-orange-dim: rgba(226, 98, 20, 0.12);
  --cyan-accent: #0088A3;

  /* Borders & Shadows */
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);
  --border-dark: rgba(255, 255, 255, 0.12);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.10);

  /* Typography Scales */
  --font-heading: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'Space Grotesk', monospace;

  /* Transitions & Layout */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --container-max: 1400px;
  --header-height: 80px;
}

/* Dark Theme Overrides */
[data-theme="dark"] {
  --bg-primary: #090C12;
  --bg-secondary: #0F141F;
  --bg-surface: #141A26;
  --bg-surface-elevated: #1B2232;
  --bg-card: #141A26;
  --bg-dark-section: #07090E;
  --bg-dark-card: #101520;

  --text-primary: #F4F2EC;
  --text-secondary: #A0AEC0;
  --text-muted: #64748B;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  overflow-x: hidden;
  line-height: 1.6;
  background-color: var(--bg-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.drawer-open-lock {
  overflow: hidden;
}

/* Typography Defaults */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

h1 {
  font-size: clamp(2.4rem, 4.8vw, 3.8rem);
}

h2 {
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
}

h3 {
  font-size: clamp(1.3rem, 2vw, 1.75rem);
}

p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

/* Layout Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 2rem;
}

@media (max-width: 768px) {
  .container {
    padding: 0 1.25rem;
  }
}

/* Badges & Eyebrows */
.badge-copper {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: var(--copper-dim);
  border: 1px solid rgba(229, 106, 56, 0.28);
  color: var(--copper-dot);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--copper-dot);
  display: inline-block;
  box-shadow: 0 0 10px var(--copper-glow);
}

.badge-gold, .badge-accent {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  background: var(--copper-dim);
  border: 1px solid rgba(226, 98, 20, 0.28);
  color: var(--copper-dot);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.85rem 1.75rem;
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.25s var(--ease-out-expo);
  border: none;
  white-space: nowrap;
}

.btn-primary {
  background: #12161E;
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] .btn-primary {
  background: #FFFFFF;
  color: #090C12;
}

.btn-primary:hover {
  transform: translateY(-2px);
  background: var(--copper-dot);
  color: #FFFFFF;
  box-shadow: 0 8px 24px rgba(229, 106, 56, 0.3);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
  border-color: var(--text-primary);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}

.btn-outline:hover {
  border-color: var(--copper-dot);
  color: var(--copper-dot);
  background: var(--copper-dim);
}

.btn-sm {
  padding: 0.55rem 1.15rem;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
}

/* ==========================================================================
   Navigation Bar & Header
   ========================================================================== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 100;
  background-color: rgba(250, 249, 246, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  transition: all 0.3s ease;
}

.site-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 5%, var(--copper-dot) 45%, var(--copper-light) 55%, transparent 95%);
  opacity: 0.85;
}

[data-theme="dark"] .site-header {
  background-color: rgba(9, 12, 18, 0.94);
  border-bottom: 1px solid var(--border-subtle);
}

.site-header.header-scrolled {
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand-logo-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-partner-badge {
  display: none !important;
}

.brand-logo-img {
  height: 38px;
  width: auto;
  object-fit: contain;
  display: block;
}

/* Show transparent dark text logo in light mode, white text logo in dark mode */
.logo-light {
  display: block;
}
.logo-dark {
  display: none;
}
[data-theme="dark"] .logo-light {
  display: none;
}
[data-theme="dark"] .logo-dark {
  display: block;
}

/* Main Navigation Menu */
.main-nav {
  display: flex;
  align-items: center;
  gap: 2.2rem;
}

@media (max-width: 992px) {
  .main-nav {
    display: none;
  }
}

.nav-link {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.5rem 0;
  position: relative;
  transition: color 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--copper-dot);
  border-radius: var(--radius-full);
}

/* Dropdown */
.nav-dropdown-item {
  position: relative;
}

.nav-dropdown-item .dropdown-toggle {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-chevron {
  transition: transform 0.25s var(--ease-out-expo);
  flex-shrink: 0;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0.6rem;
  width: 320px;
  max-width: 90vw;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.25s var(--ease-out-expo);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28), 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 120;
}

.nav-dropdown-item:hover .nav-dropdown-menu,
.nav-dropdown-item.is-open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown-item:hover .nav-chevron,
.nav-dropdown-item.is-open .nav-chevron {
  transform: rotate(180deg);
}

.nav-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem 0.6rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 0.35rem;
}

.dropdown-header-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}

.dropdown-header-all {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--copper-dot);
  text-decoration: none;
  transition: color 0.2s ease;
}

.dropdown-header-all:hover {
  color: var(--gold-primary);
  text-decoration: underline;
}

.nav-dropdown-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-dropdown-link {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}

.nav-dropdown-link:hover {
  background: var(--bg-surface-elevated);
  transform: translateX(3px);
}

.nav-dropdown-link .title {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
}

.nav-dropdown-link:hover .title {
  color: var(--copper-dot);
}

.nav-dropdown-link .sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.2;
  margin-top: 2px;
}

/* Mobile Nav Drawer Subitems */
.mobile-nav-subitems {
  display: flex;
  flex-direction: column;
  padding: 0.4rem 0 0.8rem 1.25rem;
  gap: 0.4rem;
  border-bottom: 1px solid var(--border-subtle);
}

.mobile-sublink {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.mobile-sublink:hover {
  color: var(--copper-dot);
}

/* Hide Version 3 completely across the site */
[href*="fabrics-grid-editorial.html"],
.version-tab-link[href*="fabrics-grid-editorial.html"] {
  display: none !important;
}

/* Header Action Buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  border-color: var(--copper-dot);
  color: var(--copper-dot);
}

.theme-toggle-btn .icon-moon {
  display: block;
}
.theme-toggle-btn .icon-sun {
  display: none;
}
[data-theme="dark"] .theme-toggle-btn .icon-moon {
  display: none;
}
[data-theme="dark"] .theme-toggle-btn .icon-sun {
  display: block;
}

.swatch-cart-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.swatch-cart-btn:hover {
  border-color: var(--copper-dot);
  color: var(--copper-dot);
}

.swatch-count-badge {
  background: var(--copper-dot);
  color: #FFF;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.4rem;
}

@media (max-width: 992px) {
  .mobile-menu-toggle {
    display: block;
  }
}

/* Mobile Nav Drawer */
.mobile-nav-drawer {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: 100%;
  height: calc(100vh - var(--header-height));
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transform: translateX(-100%);
  transition: transform 0.35s var(--ease-out-expo);
  z-index: 99;
  overflow-y: auto;
}

.mobile-nav-drawer.is-open {
  transform: translateX(0);
}

.mobile-nav-drawer .nav-link {
  font-size: 1.25rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

/* ==========================================================================
   Version Switcher Banner
   ========================================================================== */
.version-switcher-bar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.65rem 0;
  margin-top: var(--header-height);
}

.version-switcher-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.version-switcher-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-family: var(--font-heading);
}

.version-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.version-tab-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: all 0.2s ease;
}

.version-tab-link:hover, .version-tab-link.active {
  color: var(--text-primary);
  border-color: var(--copper-dot);
}

.version-tab-link.active {
  background: var(--copper-dim);
  color: var(--copper-dot);
  font-weight: 700;
}

/* ==========================================================================
   Editorial Hero Section (Architectural & Anti-AI Slop)
   ========================================================================== */
.editorial-hero-section {
  padding: calc(var(--header-height) + 3.5rem) 0 4.5rem;
  background-color: var(--bg-primary);
  position: relative;
  border-bottom: 1px solid var(--border-subtle);
}

.editorial-hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 4rem;
  align-items: center;
}

@media (max-width: 992px) {
  .editorial-hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

.hero-partner-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  background: var(--copper-dim);
  border: 1px solid rgba(229, 106, 56, 0.28);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--copper-dot);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
}

.hero-headline {
  font-size: clamp(2.3rem, 4.2vw, 3.6rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.hero-subhead {
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 58ch;
  margin-bottom: 2rem;
}

.hero-actions-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.75rem;
}

.hero-procurement-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
}

@media (max-width: 640px) {
  .hero-procurement-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
}

.procure-item .val {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.procure-item .lbl {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.hero-asset-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  background: var(--bg-surface);
  aspect-ratio: 4 / 3.4;
}

.hero-main-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-spec-tag {
  position: absolute;
  background: rgba(18, 22, 30, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 0.75rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
}

.hero-spec-tag.top-right {
  top: 1.25rem;
  right: 1.25rem;
}

.hero-spec-tag.bottom-left {
  bottom: 1.25rem;
  left: 1.25rem;
}

.hero-spec-tag .code {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--copper-dot);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.15rem;
}

.hero-spec-tag .title {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
}

/* Sticky Fabric Detail Left Column on Desktop */
@media (min-width: 993px) {
  .detail-split-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 4.5rem;
    align-items: start;
  }
  .fabric-viewer-card {
    position: sticky;
    top: calc(var(--header-height) + 2rem);
    z-index: 10;
  }
}

/* ==========================================================================
   Dark Contrast Section Utilities
   ========================================================================== */
.dark-section {
  background-color: var(--bg-dark-section);
  color: var(--text-on-dark);
}

.dark-section h1, .dark-section h2, .dark-section h3, .dark-section h4 {
  color: #FFFFFF;
}

.dark-section p {
  color: var(--text-on-dark-muted);
}

/* ==========================================================================
   Site Footer
   ========================================================================== */
.site-footer {
  background-color: var(--bg-dark-section);
  color: var(--text-on-dark);
  border-top: 1px solid var(--border-dark);
  padding: 5rem 0 2.5rem;
}

.site-footer h4 {
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #FFFFFF;
  margin-bottom: 1.25rem;
  font-family: var(--font-mono);
}

.site-footer p {
  color: var(--text-on-dark-muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 3.5rem;
  margin-bottom: 4rem;
}

@media (max-width: 992px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 576px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.footer-logo {
  height: 40px;
  width: auto;
  margin-bottom: 1.25rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  color: var(--text-on-dark-muted);
  font-size: 0.88rem;
  transition: color 0.2s ease, transform 0.2s ease;
  display: inline-block;
}

.footer-links a:hover {
  color: var(--copper-dot);
  transform: translateX(3px);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 2rem;
  border-top: 1px solid var(--border-dark);
  font-size: 0.82rem;
  color: var(--text-on-dark-muted);
  flex-wrap: wrap;
  gap: 1rem;
}

/* -------------------------------------------------------------
   Soft, Minimal Global Scrollbar (Quiet Luxury Aesthetic)
   ------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.14);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.32);
}

html, body {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

[data-theme="dark"] html,
[data-theme="dark"] body {
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}
