/**
 * Default Theme CSS
 * Clean, neutral design that works for any store type.
 * Grayscale aesthetic with elegant black-to-white transitions.
 *
 * All colors are driven by API theme colors (primary, secondary, neutral scales).
 * ColorManagerService injects --primary-50..900, --secondary-50..900, --neutral-50..900 on :root.
 */

:root {
  --font-heading: 'Inter', system-ui, sans-serif;
  /* Radius scale - soft, modern corners used across buttons/cards/inputs/badges */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 999px;

  /* Primary / secondary semantics - brand-driven */
  --primary-main: var(--primary-500);
  --primary-hover: var(--primary-600);
  --primary-light: var(--primary-200);
  --primary-dark: var(--primary-700);

  /* Hero / dark-section gradients - subtle brand tint instead of flat black */
  --primary-gradient: linear-gradient(135deg, var(--primary-700) 0%, var(--neutral-900) 100%);
  --hero-gradient: linear-gradient(160deg, var(--primary-900) 0%, var(--neutral-900) 55%, var(--neutral-950, var(--neutral-900)) 100%);
  --hero-gradient-alt: linear-gradient(135deg, var(--neutral-800) 0%, var(--neutral-700) 100%);

  --secondary-main: var(--secondary-500);
  --secondary-hover: var(--secondary-600);
  --secondary-light: var(--secondary-200);
  --secondary-dark: var(--secondary-700);

  /* Feature icon - soft brand-tinted background */
  --feature-icon-bg: var(--primary-50);
  --feature-icon-border: var(--primary-100);

  /* Backgrounds - clean white/gray */
  --background-primary: #FFFFFF;
  --background-secondary: var(--neutral-50);
  --background-card: #FFFFFF;
  --background-overlay: rgba(0, 0, 0, 0.5);

  /* Text - high contrast */
  --text-primary: var(--neutral-900);
  --text-secondary: var(--neutral-600);
  /* Was --neutral-400 (2.7:1 on white, fails WCAG AA 4.5:1 — flagged by
     Lighthouse against "VERIFIED CUSTOMER" testimonial labels and stat
     labels using .theme-text-muted). --neutral-500 verified at ~4.8:1 for
     this store's actual configured neutral color (reverse-engineered the
     scale from the reported failing hex and re-derived contrast directly)
     while staying visually one step lighter than --text-secondary. */
  --text-muted: var(--neutral-500);
  --text-inverse: #FFFFFF;
  --text-link: var(--primary-600);
  --text-link-hover: var(--primary-700);

  /* Borders - subtle */
  --border-light: var(--neutral-200);
  --border-medium: var(--neutral-300);
  --border-dark: var(--neutral-400);
  --border-focus: var(--primary-500);

  /* Shadows - soft, with a touch more presence for real depth on hover */
  --shadow-sm: 0 1px 3px 0 rgba(15, 15, 20, 0.06), 0 1px 2px 0 rgba(15, 15, 20, 0.04);
  --shadow-base: 0 2px 6px -1px rgba(15, 15, 20, 0.08), 0 1px 3px 0 rgba(15, 15, 20, 0.05);
  --shadow-md: 0 8px 16px -4px rgba(15, 15, 20, 0.10), 0 3px 6px -2px rgba(15, 15, 20, 0.06);
  --shadow-lg: 0 20px 32px -8px rgba(15, 15, 20, 0.14), 0 6px 12px -4px rgba(15, 15, 20, 0.08);
  --shadow-xl: 0 28px 48px -10px rgba(15, 15, 20, 0.18), 0 12px 16px -6px rgba(15, 15, 20, 0.08);

  /* Buttons - brand primary drives every CTA */
  --button-primary-background: var(--primary-600);
  --button-primary-background-hover: var(--primary-700);
  --button-primary-text: #FFFFFF;
  --button-primary-border: var(--primary-600);

  --button-secondary-background: var(--neutral-100);
  --button-secondary-background-hover: var(--neutral-200);
  --button-secondary-text: var(--neutral-900);
  --button-secondary-border: var(--neutral-200);

  --button-outline-background: transparent;
  --button-outline-background-hover: var(--primary-600);
  --button-outline-text: var(--neutral-900);
  --button-outline-text-hover: #FFFFFF;
  --button-outline-border: var(--neutral-300);

  --button-ghost-background: transparent;
  --button-ghost-background-hover: var(--primary-50);
  --button-ghost-text: var(--neutral-700);
  --button-ghost-text-hover: var(--primary-700);
  --button-ghost-border: transparent;

  /* Badges - brand-tinted */
  --badge-primary-bg: var(--primary-50);
  --badge-primary-text: var(--primary-700);
  --badge-primary-border: var(--primary-200);

  /* Form - clean */
  --form-input-background: #FFFFFF;
  --form-input-background-focus: #FFFFFF;
  --form-input-text: var(--neutral-900);
  --form-input-placeholder: var(--neutral-400);
  --form-input-border: var(--neutral-300);
  --form-input-border-focus: var(--primary-500);
  --form-label-text: var(--neutral-700);

  /* Card - soft elevation */
  --card-background: #FFFFFF;
  --card-border: var(--neutral-200);
  --card-shadow: var(--shadow-sm);
  --card-shadow-hover: var(--shadow-lg);

  /* Navigation - light and clean, brand accent on active/hover */
  --navigation-background: #FFFFFF;
  --navigation-text: var(--neutral-600);
  --navigation-text-hover: var(--primary-600);
  --navigation-border: var(--neutral-200);
  --navigation-active: var(--primary-600);

  /* Footer - dark */
  --footer-background: var(--neutral-900);
  --footer-text: #FFFFFF;
  --footer-text-secondary: var(--neutral-400);
  --footer-border: var(--neutral-700);

  /* Newsletter - dark section, subtle brand tint so it doesn't read as identical black to the footer */
  --newsletter-gradient: linear-gradient(135deg, var(--neutral-900) 0%, var(--primary-900) 130%);
  --newsletter-text: #FFFFFF;
  --newsletter-input-border: var(--neutral-700);
  --newsletter-cta-bg: #FFFFFF;
  --newsletter-cta-text: var(--neutral-900);

  /* Product */
  --product-price-regular: var(--neutral-900);
  --product-badge-new: var(--primary-600);
  --product-badge-sale: #DC2626;
  --product-badge-out-of-stock: var(--neutral-400);

  /* Loading */
  --loading-spinner: var(--primary-600);
  --loading-overlay: rgba(255, 255, 255, 0.9);

  /* Semantic */
  --error-main: #DC2626;
  --error-foreground: #FFFFFF;
  --warning-main: #D97706;
  --warning-foreground: var(--neutral-900);
  --success-main: #16A34A;
  --success-foreground: #FFFFFF;
  --info-main: var(--neutral-600);
  --info-foreground: #FFFFFF;

  /* Legacy aliases */
  --primary-color: var(--primary-main);
  --secondary-color: var(--secondary-main);
  --background-color: var(--background-primary);
  --text-linkHover: var(--text-link-hover);
  --form-input-borderError: var(--error-main);
  --form-input-borderFocus: var(--form-input-border-focus);
  --button-primary-backgroundHover: var(--button-primary-background-hover);
  --button-secondary-backgroundHover: var(--button-secondary-background-hover);
  --button-outline-textHover: var(--button-outline-text-hover);
  --navigation-textHover: var(--navigation-text-hover);
  --card-shadowHover: var(--card-shadow-hover);
}

/* Typography – driven by font-manager (--font-heading / --font-body) */
.theme-default {
  font-family: var(--font-body, 'Inter', system-ui, sans-serif);
  max-width: 100%;
  overflow-x: clip;
}
.theme-default h1,
.theme-default h2,
.theme-default h3,
.theme-default h4,
.theme-default h5,
.theme-default h6 {
  font-family: var(--font-heading, 'Inter', system-ui, sans-serif);
}

/* Smooth, subtle motion by default on every interactive element - this is
   what makes hover/focus states feel alive instead of an instant colour snap. */
.theme-default a,
.theme-default button {
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease,
    box-shadow 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
  .theme-default * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@keyframes theme-fade-in-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.theme-animate-in {
  animation: theme-fade-in-up 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.theme-animate-in--delay-1 { animation-delay: 0.08s; }
.theme-animate-in--delay-2 { animation-delay: 0.16s; }
.theme-animate-in--delay-3 { animation-delay: 0.24s; }

/* ========== Theme utility classes ========== */

/* Layout & surfaces */
.theme-bg-page {
  background-color: var(--background-primary);
}

.theme-hover-bg-subtle:hover {
  background-color: var(--neutral-50);
}

.theme-bg-card {
  background-color: var(--card-background);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.theme-bg-hero {
  background: var(--hero-gradient);
  color: var(--text-inverse);
}

.theme-bg-section-alt {
  background-color: var(--background-secondary);
}

.theme-bg-footer {
  background-color: var(--footer-background);
  color: var(--footer-text);
}

.theme-bg-newsletter {
  background: var(--newsletter-gradient);
  color: var(--newsletter-text);
}

/* Nav - clean minimal */
.theme-nav {
  background-color: var(--navigation-background);
  border-bottom: 1px solid var(--navigation-border);
}

.theme-nav-link {
  color: var(--navigation-text);
  transition: color 0.2s ease;
}

.theme-nav-link:hover {
  color: var(--navigation-text-hover);
}

.theme-nav-link.router-link-active {
  color: var(--navigation-active);
}

.theme-nav-cart-badge {
  background-color: var(--primary-600);
  color: #FFFFFF;
  border-radius: var(--radius-full);
}

/* Text */
.theme-text-heading {
  color: var(--text-primary);
}

.theme-text-body {
  color: var(--text-secondary);
}

.theme-text-muted {
  color: var(--text-muted);
}

.theme-link {
  color: var(--text-link);
}

.theme-link:hover {
  color: var(--text-link-hover);
}

/* Borders & dividers */
.theme-border {
  border-color: var(--border-light);
}

.theme-border-t {
  border-top: 1px solid var(--border-light);
}

.theme-border-b {
  border-bottom: 1px solid var(--border-light);
}

/* Buttons - brand-driven, with a soft lift on hover */
.theme-btn-primary {
  background-color: var(--button-primary-background);
  color: var(--button-primary-text);
  border: 1px solid var(--button-primary-border);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.theme-btn-primary:hover:not(:disabled) {
  background-color: var(--button-primary-background-hover);
  border-color: var(--button-primary-background-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.theme-btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: none;
}

.theme-btn-secondary {
  background-color: var(--button-secondary-background);
  color: var(--button-secondary-text);
  border: 1px solid var(--button-secondary-border);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.theme-btn-secondary:hover:not(:disabled) {
  background-color: var(--button-secondary-background-hover);
  border-color: var(--button-secondary-background-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.theme-btn-outline {
  background-color: var(--button-outline-background);
  color: var(--button-outline-text);
  border: 1px solid var(--button-outline-border);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.theme-btn-outline:hover:not(:disabled) {
  background-color: var(--button-outline-background-hover);
  color: var(--button-outline-text-hover);
  border-color: var(--button-outline-background-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.theme-btn-ghost {
  background-color: var(--button-ghost-background);
  color: var(--button-ghost-text);
  border: 1px solid var(--button-ghost-border);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.theme-btn-ghost:hover:not(:disabled) {
  background-color: var(--button-ghost-background-hover);
  color: var(--button-ghost-text-hover);
}

/* Hero outline button */
.theme-btn-hero-outline {
  background: transparent;
  color: #FFFFFF;
  border: 1px solid var(--neutral-600);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.theme-btn-hero-outline:hover {
  background: #FFFFFF;
  color: var(--neutral-900);
  border-color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Badges - brand-tinted pill */
.theme-badge {
  background-color: var(--badge-primary-bg);
  color: var(--badge-primary-text);
  border: 1px solid var(--badge-primary-border);
  border-radius: var(--radius-full);
}

/* Cards & product - soft elevation, lifts on hover */
.theme-product-card {
  background-color: var(--card-background);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-product-card:hover {
  border-color: var(--neutral-300);
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-6px);
}

.theme-product-price {
  color: var(--product-price-regular);
  font-weight: 600;
}

.theme-add-to-cart {
  background-color: var(--button-primary-background);
  color: var(--button-primary-text);
  border: 1px solid var(--button-primary-border);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.theme-add-to-cart:hover:not(:disabled) {
  background-color: var(--button-primary-background-hover);
  border-color: var(--button-primary-background-hover);
  box-shadow: var(--shadow-md);
}

.theme-add-to-cart:disabled {
  background-color: var(--neutral-200);
  color: var(--neutral-500);
  border-color: var(--neutral-200);
  cursor: not-allowed;
}

/* Form inputs - clean */
.theme-input {
  background-color: var(--form-input-background);
  color: var(--form-input-text);
  border: 1px solid var(--form-input-border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.theme-input:focus {
  outline: none;
  border-color: var(--form-input-border-focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-500) 18%, transparent);
}

.theme-input::placeholder {
  color: var(--form-input-placeholder);
}

/* Footer - minimal */
.theme-footer-link {
  color: var(--footer-text-secondary);
  transition: color 0.2s ease;
}

.theme-footer-link:hover {
  color: var(--footer-text);
}

.theme-footer-social-border {
  border: 1px solid var(--footer-border);
  border-radius: var(--radius-full);
  transition: all 0.2s ease;
}

.theme-footer-social-border:hover {
  background-color: #FFFFFF;
  border-color: #FFFFFF;
  color: var(--neutral-900);
  transform: translateY(-2px);
}

/* Section title underline - brand-coloured, rounded ends */
.theme-title-underline {
  background-color: var(--primary-500);
  height: 3px;
  border-radius: var(--radius-full);
}

/* Newsletter CTA */
.theme-newsletter-cta {
  background-color: var(--newsletter-cta-bg);
  color: var(--newsletter-cta-text);
  border: 1px solid var(--newsletter-cta-bg);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.theme-newsletter-cta:hover {
  background-color: var(--neutral-100);
  border-color: var(--neutral-100);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.theme-newsletter-input {
  background: transparent;
  border: 1px solid var(--newsletter-input-border);
  color: var(--newsletter-text);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s ease;
}

.theme-newsletter-input::placeholder {
  color: var(--neutral-500);
}

.theme-newsletter-input:focus {
  border-color: var(--neutral-500);
  outline: none;
}
