/* ==========================================================================
   Clierry Centralized Theme & Shared Components
   Design System: Warm Editorial Cherry Charcoal & Parchment
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Nunito+Sans:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

/* --- 1. DESIGN TOKENS --- */
/* Legacy tokens contract: --paper: #faf9f6; --ink: #101917; --green: #254832; --sage: #e7ecdf; --muted: #737b80; --line: #e5e4de; --gold: #a68a55; */
:root {
  color-scheme: dark;

  /* Primary Dark Canvas */
  --paper: #191618;          /* Canvas background */
  --paper-dark: #191618;     /* Subtle warm cherry charcoal */
  --paper-portal: #17181c;   /* Flat dark panels / showcase */
  --ink: #f0edef;            /* Primary typography */
  --ink-light: #f0edef;      /* Crisp light text for dark surfaces */
  --text-primary: #f0edef;   /* Primary typography */
  --text-secondary: #dcd7db; /* Navigation & secondary copy */

  /* Brand Cherry Accents */
  --red: #e50042;            /* Signature Clierry Cherry brand accent */
  --cherry: #e50042;         /* Primary brand accent */
  --cherry-hover: #c40038;   /* Interactive hover cherry */
  --cherry-glow: #ff3b6f;    /* Signature cherry glow */

  /* Legacy Aliases (mapped to dark / cherry tokens to avoid green rendering) */
  --green: #e50042;          /* Legacy alias to cherry red */
  --sage: rgba(229, 0, 66, 0.12); /* Legacy alias to cherry glow tint */
  --gold: #cfc3c8;           /* Editorial muted sub-accent */

  /* Muted Text & Dividers */
  --muted: #a69fa3;          /* Secondary body text */
  --muted-dark: #a69fa3;     /* Muted slate for dark surfaces */
  --line: #332b30;           /* Hairline card & header border */
  --line-dark: #332b30;      /* Subtle dark border */
  --border: #282930;         /* Section & card borders */

  /* Surfaces & Panels */
  --surface: #1e1f24;
  --surface-header: #1e1f23f2;
  --surface-card: #1e1f23;
  --surface-card-gradient: linear-gradient(145deg, #292226, #201a1e);
  --surface-input: #262125;
  --surface-input-focus: #292a34;
  --surface-footer: #130f12;

  /* Typography Stacks */
  --heading: 'Fredoka', 'Outfit', sans-serif;
  --font-heading: var(--heading);
  --body: 'Nunito Sans', 'Plus Jakarta Sans', sans-serif;
  --font-body: var(--body);

  /* Geometry & Radii */
  --radius-sm: 6px;
  --radius-md: 9px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows & Elevations */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.42), 0 0 16px rgba(229, 0, 66, 0.12);
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.28);
  --shadow-focus: 0 0 0 3px rgba(229, 0, 66, 0.25);
}

/* --- 2. BASE UTILITIES & RESET HARMONY --- */
.shell {
  width: min(1320px, calc(100% - 48px));
  margin-inline: auto;
  box-sizing: border-box;
}

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

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

/* --- 3. STANDARD BUTTON CLASSES --- */
/* Base button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--cherry, #e50042) !important;
  color: #ffffff !important;
  border: 1px solid transparent !important;
  border-radius: var(--radius-sm, 6px);
  font-family: var(--heading, 'Fredoka', 'Outfit', sans-serif);
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 20px;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
  letter-spacing: 0.15px;
  box-sizing: border-box;
  min-height: 38px;
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

/* Primary Cherry Button */
.btn-cherry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--cherry, #e50042) !important;
  color: #ffffff !important;
  border: 1px solid transparent !important;
  border-radius: var(--radius-sm, 6px) !important;
  font-family: var(--heading, 'Fredoka', 'Outfit', sans-serif) !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  padding: 10px 20px !important;
  cursor: pointer !important;
  text-decoration: none !important;
  line-height: 1.2 !important;
  letter-spacing: 0.15px !important;
  box-sizing: border-box !important;
  min-height: 38px;
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease !important;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--cherry, #e50042) !important;
  color: #ffffff !important;
  border: 1px solid transparent !important;
  border-radius: var(--radius-sm, 6px) !important;
  font-family: var(--heading, 'Fredoka', 'Outfit', sans-serif) !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  padding: 10px 20px !important;
  cursor: pointer !important;
  text-decoration: none !important;
  line-height: 1.2 !important;
  letter-spacing: 0.15px !important;
  box-sizing: border-box !important;
  min-height: 38px;
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease !important;
}

.wx-btn-primary,
.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--cherry, #e50042) !important;
  color: #ffffff !important;
  border: 1px solid transparent !important;
  border-radius: var(--radius-sm, 6px) !important;
  font-family: var(--heading, 'Fredoka', 'Outfit', sans-serif) !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  padding: 10px 20px !important;
  cursor: pointer !important;
  text-decoration: none !important;
  line-height: 1.2 !important;
  letter-spacing: 0.15px !important;
  box-sizing: border-box !important;
  min-height: 38px;
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease !important;
}

.btn:hover,
.btn-cherry:hover,
.wx-btn-primary:hover,
.btn-primary:hover,
.btn-submit:hover {
  background-color: var(--cherry-hover, #c40038) !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(229, 0, 66, 0.35);
}

.btn:active,
.btn-cherry:active,
.wx-btn-primary:active,
.btn-primary:active,
.btn-submit:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn:disabled,
.btn-cherry:disabled,
.wx-btn-primary:disabled,
.btn-primary:disabled,
.btn-submit:disabled {
  opacity: 0.55 !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Secondary / Ghost Button */
.btn-ghost,
.wx-btn-secondary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: rgba(255, 255, 255, 0.08) !important;
  color: #e5e7eb !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: var(--radius-sm, 6px) !important;
  font-family: var(--heading, 'Fredoka', 'Outfit', sans-serif) !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  padding: 8px 18px !important;
  cursor: pointer !important;
  text-decoration: none !important;
  line-height: 1.2 !important;
  box-sizing: border-box !important;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease !important;
}

.btn-ghost:hover,
.wx-btn-secondary:hover,
.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  transform: translateY(-1px);
}

.btn-ghost:active,
.wx-btn-secondary:active,
.btn-secondary:active {
  transform: translateY(0);
}

/* Text Links */
.text-link {
  font-family: var(--heading, 'Fredoka', 'Outfit', sans-serif);
  font-size: 13px;
  font-weight: 600;
  color: #e6dee3;
  text-decoration: none;
  border-bottom: 1px solid #7c5f6e;
  padding-bottom: 2px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.text-link:hover {
  color: #ffffff;
  border-color: var(--cherry, #e50042);
}

/* --- 4. FORM INPUTS --- */
.form-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
select,
textarea {
  font-family: var(--body, 'Nunito Sans', 'Plus Jakarta Sans', sans-serif);
  font-size: 14px;
  font-weight: 500;
  color: #f5f3f7;
  background-color: var(--surface-input, #25262f);
  border: 1px solid #3a3b45;
  border-radius: var(--radius-md, 9px);
  padding: 10px 14px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-input::placeholder,
input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder,
input[type="search"]::placeholder,
textarea::placeholder {
  color: #8b8d99;
  font-weight: 400;
}

.form-input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
  border-color: var(--cherry, #e50042) !important;
  background-color: var(--surface-input-focus, #292a34) !important;
  box-shadow: var(--shadow-focus, 0 0 0 3px rgba(229, 0, 66, 0.25)) !important;
}

/* --- 5. ALERTS & NOTIFICATIONS --- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md, 9px);
  font-family: var(--body, 'Nunito Sans', 'Plus Jakarta Sans', sans-serif);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Warm sage editorial styling */
.alert.success {
  background: #15291b !important;
  color: #4ade80 !important;
  border: 1px solid #234c30 !important;
  display: flex !important;
}

/* Warm rose editorial styling */
.alert.error {
  background: #2b171c !important;
  color: #ff85a1 !important;
  border: 1px solid #611e2f !important;
  display: flex !important;
}

.alert.warning {
  background: #2a2215 !important;
  color: #ffd166 !important;
  border: 1px solid #5a441e !important;
  display: flex !important;
}

.alert:empty {
  display: none !important;
}

/* --- 6. CARDS, BADGES & PANELS --- */
.editorial-card,
.card-panel {
  background: var(--surface-card-gradient);
  border: 1px solid var(--line-dark, #332b30);
  border-radius: var(--radius-lg, 12px);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.editorial-card:hover,
.card-panel:hover {
  transform: translateY(-3px);
  border-color: #5c4852;
  box-shadow: var(--shadow-lg);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full, 9999px);
  font-family: var(--heading, 'Fredoka', 'Outfit', sans-serif);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1;
}

.badge-cherry {
  background: rgba(229, 0, 66, 0.12);
  color: #ff6e96;
  border: 1px solid rgba(229, 0, 66, 0.25);
}

.badge-sage {
  background: rgba(229, 0, 66, 0.12);
  color: #ff6e96;
  border: 1px solid rgba(229, 0, 66, 0.25);
}

/* --- 7. GLOBAL NAVIGATION HEADER (.site-header) --- */
.site-header {
  font-family: var(--heading, 'Fredoka', 'Outfit', 'Nunito Sans', sans-serif) !important;
  border-bottom: 1px solid #36383f !important;
  background: #1e1f23f2 !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  box-sizing: border-box;
}

.header-inner {
  height: 68px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 22px !important;
  width: min(1320px, calc(100% - 48px)) !important;
  margin-inline: auto !important;
  box-sizing: border-box !important;
}

.brand {
  display: flex !important;
  align-items: center !important;
  flex-shrink: 0 !important;
  text-decoration: none !important;
  position: static !important;
}

.brand::after,
.brand:after {
  display: none !important;
}

.brand img {
  width: 124px !important;
  height: auto !important;
  display: block !important;
  mix-blend-mode: normal !important;
  filter: none !important;
}

.header-search {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex: 1 1 280px !important;
  max-width: 360px !important;
  height: 38px !important;
  padding: 0 14px !important;
  border-radius: var(--radius-md, 9px) !important;
  border: 1px solid #3a3b45 !important;
  background: #25262f !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  position: relative !important;
  transition: border-color .2s, box-shadow .2s, background-color .2s !important;
}

.header-search:focus-within {
  border-color: var(--cherry, #e50042) !important;
  background: #292a34 !important;
  box-shadow: var(--shadow-focus, 0 0 0 3px rgba(229, 0, 66, 0.16)) !important;
}

.header-search .icon {
  width: 15px !important;
  height: 15px !important;
  color: #989aa6 !important;
  flex-shrink: 0 !important;
}

.header-search input {
  border: none !important;
  background: transparent !important;
  outline: none !important;
  width: 100% !important;
  font-family: var(--heading, 'Fredoka', 'Outfit', sans-serif) !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  color: #f5f3f7 !important;
  letter-spacing: 0.15px !important;
  padding: 0 !important;
  box-shadow: none !important;
}

.header-search input::placeholder {
  color: #8b8d99 !important;
  font-weight: 400 !important;
}

.main-nav {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  height: auto !important;
  margin-left: 12px !important;
  margin-right: 0 !important;
  font-family: var(--heading, 'Fredoka', 'Outfit', sans-serif) !important;
}

.nav-link {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  padding: 6px 12px !important;
  border-radius: var(--radius-full, 999px) !important;
  font-family: var(--heading, 'Fredoka', 'Outfit', sans-serif) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  letter-spacing: 0.15px !important;
  color: #d6d5dd !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  transition: color .2s, background-color .2s !important;
}

.nav-link:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.07) !important;
}

.nav-link[aria-pressed=true],
.nav-link.active-page {
  color: #ffffff !important;
  font-weight: 600 !important;
}

.nav-link[aria-pressed=true]:after,
.nav-link.active-page:after {
  content: '' !important;
  position: absolute !important;
  left: 12px !important;
  right: 12px !important;
  bottom: -5px !important;
  height: 2.5px !important;
  border-radius: 2px !important;
  background: var(--cherry, #e50042) !important;
}

.header-tools {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  flex-shrink: 0 !important;
  margin-left: 8px !important;
}

.cart-nav {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 38px !important;
  height: 38px !important;
  border-radius: 10px !important;
  color: #dedce6 !important;
  background: transparent !important;
  text-decoration: none !important;
  transition: background-color .2s, color .2s !important;
}

.cart-nav:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

.cart-nav .icon {
  width: 20px !important;
  height: 20px !important;
  stroke-width: 1.8 !important;
}

.cart-count {
  position: absolute !important;
  top: -4px !important;
  right: -4px !important;
  background: var(--cherry, #e50042) !important;
  color: #ffffff !important;
  font-family: var(--heading, 'Fredoka', 'Outfit', sans-serif) !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  min-width: 17px !important;
  height: 17px !important;
  border-radius: 50% !important;
  display: flex;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  border: 1.5px solid #191618 !important;
  box-sizing: border-box !important;
  box-shadow: 0 2px 6px rgba(229, 0, 66, 0.4) !important;
  pointer-events: none !important;
}

.cart-count:empty,
.cart-count[data-count="0"],
.cart-count.hidden {
  display: none !important;
}

.menu-toggle {
  display: none !important;
  border: 0 !important;
  background: none !important;
  padding: 5px !important;
  color: #d6d5dd !important;
  cursor: pointer !important;
}

.menu-toggle .icon,
.menu-toggle svg {
  width: 24px !important;
  height: 24px !important;
  display: block !important;
  stroke: currentColor !important;
  fill: none !important;
}

/* Header Responsive Breakpoints */
@media(max-width: 1200px) {
  .header-inner {
    gap: 16px !important;
  }
  .header-search {
    max-width: 280px !important;
  }
  .main-nav {
    gap: 8px !important;
    margin-left: 6px !important;
  }
  .nav-link {
    padding: 6px 10px !important;
    font-size: 13.5px !important;
  }
}

@media(max-width: 950px) {
  .header-inner {
    gap: 12px !important;
  }
  .header-search {
    flex: 1 1 180px !important;
    max-width: 220px !important;
    height: 36px !important;
  }
  .main-nav {
    gap: 4px !important;
    margin-left: 2px !important;
  }
  .nav-link {
    padding: 5px 8px !important;
    font-size: 13px !important;
  }
}

/* Tablet & Mobile Drawer Alignment (eliminates 8px tablet gap at 768px) */
@media(max-width: 768px) {
  .menu-toggle {
    display: block !important;
  }
  .site-header .header-search {
    display: none !important;
  }
  .main-nav {
    display: none !important;
    position: absolute !important;
    top: 60px !important;
    left: 0 !important;
    right: 0 !important;
    background: #1e1f25 !important;
    border-bottom: 1px solid #363842 !important;
    padding: 14px 18px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    margin: 0 !important;
    box-shadow: 0 16px 30px rgba(0,0,0,0.45) !important;
    z-index: 999 !important;
  }
  .main-nav.open {
    display: flex !important;
  }
}

@media(max-width: 760px) {
  .header-inner {
    height: 60px !important;
    gap: 10px !important;
    width: calc(100% - 32px) !important;
  }
  .brand img {
    width: 112px !important;
  }
  .menu-toggle {
    display: block !important;
  }
  .site-header .header-search {
    display: none !important;
  }
  .main-nav {
    display: none !important;
    position: absolute !important;
    top: 60px !important;
    left: 0 !important;
    right: 0 !important;
    background: #1e1f25 !important;
    border-bottom: 1px solid #363842 !important;
    padding: 14px 18px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    margin: 0 !important;
    box-shadow: 0 16px 30px rgba(0,0,0,0.45) !important;
    z-index: 999 !important;
  }
  .main-nav.open {
    display: flex !important;
  }
  .main-nav .header-search {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 8px !important;
    display: flex !important;
  }
  .nav-link[aria-pressed=true]:after,
  .nav-link.active-page:after {
    display: none !important;
  }
  .nav-link[aria-pressed=true],
  .nav-link.active-page {
    background: rgba(232, 58, 103, 0.12) !important;
    color: #ff6e96 !important;
  }
}

/* --- 8. GLOBAL SITE FOOTER (footer) --- */
footer,
.site-footer {
  border-top: 1px solid var(--line-dark, #2e262b) !important;
  background: var(--surface-footer, #130f12) !important;
  padding: 25px 0 28px !important;
  font-family: var(--heading, 'Fredoka', 'Outfit', 'Nunito Sans', sans-serif) !important;
  color: #a699a0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.footer-inner {
  display: flex !important;
  align-items: center !important;
  gap: 28px !important;
  width: min(1320px, calc(100% - 48px)) !important;
  margin-inline: auto !important;
  box-sizing: border-box !important;
}

.footer-inner .brand {
  display: flex !important;
  align-items: center !important;
  text-decoration: none !important;
}

.footer-inner .brand img {
  width: 106px !important;
  height: auto !important;
  display: block !important;
  mix-blend-mode: normal !important;
  filter: none !important;
}

.footer-links {
  display: flex !important;
  gap: 20px !important;
  font-size: 10px !important;
  color: #a699a0 !important;
  align-items: center !important;
}

.footer-links a,
.footer-links button {
  border: 0 !important;
  padding: 0 !important;
  background: none !important;
  font-size: inherit !important;
  color: inherit !important;
  text-decoration: none !important;
  cursor: pointer !important;
  transition: color .2s !important;
  font-family: inherit !important;
}

.footer-links a:hover,
.footer-links button:hover {
  color: #ffccd9 !important;
}

.footer-secondary {
  margin-left: auto !important;
}

.footer-signoff {
  color: #a699a0 !important;
  font-size: 10px !important;
  font-style: italic !important;
  white-space: nowrap !important;
}

@media(max-width: 760px) {
  .footer-inner {
    flex-wrap: wrap !important;
    gap: 20px !important;
    width: calc(100% - 32px) !important;
  }
  .footer-inner .brand img {
    width: 99px !important;
  }
  .footer-links {
    font-size: 9px !important;
    gap: 16px !important;
  }
  .footer-secondary {
    margin-left: 0 !important;
  }
  .footer-signoff {
    margin-left: 0 !important;
    width: 100% !important;
    font-size: 10px !important;
  }
}
