/**
 * BAV 2.0 — Design Tokens & Shared Component Styles
 *
 * Single source of truth for all BAV frontend component styling.
 * All new BAV components MUST reference these tokens via var(--bav-*).
 * Never hardcode color, spacing, or typography values in component CSS.
 *
 * IMPORTANT:
 * - White text on gold backgrounds is FORBIDDEN (WCAG fail at 2.3:1)
 * - Always use navy text on gold backgrounds
 * - All shadows use navy-tinted rgba(26, 33, 80, ...) — not generic black
 * - Squared geometry (border-radius: 0) on all primary BAV components
 */

/* ==========================================================================
   Design Tokens
   ========================================================================== */

:root {
  /* -- Color Palette -- */
  --bav-primary: #1A2150;
  --bav-primary-hover: #141a3d;
  --bav-primary-light: #e8e9f0;
  --bav-accent: #d7af3b;
  --bav-accent-hover: #c29d2f;
  --bav-accent-light: #faf5e6;
  --bav-text: #1A2150;
  --bav-text-secondary: #6b7280;
  --bav-text-inverse: #ffffff;
  --bav-bg: #ffffff;
  --bav-bg-overlay: rgba(26, 33, 80, 0.7);
  --bav-bg-surface: #f9fafb;
  --bav-border: #e5e7eb;
  --bav-border-focus: #d7af3b;
  --bav-success: #059669;
  --bav-warning: #d97706;
  --bav-error: #dc2626;

  /* -- Typography -- */
  --bav-font-family: 'Montserrat', sans-serif;
  --bav-font-size-xs: 0.75rem;
  --bav-font-size-sm: 0.875rem;
  --bav-font-size-base: 1rem;
  --bav-font-size-lg: 1.125rem;
  --bav-font-size-xl: 1.5rem;
  --bav-font-size-2xl: 1.75rem;
  --bav-font-weight-normal: 400;
  --bav-font-weight-medium: 500;
  --bav-font-weight-semibold: 600;
  --bav-font-weight-bold: 700;
  --bav-font-weight-heavy: 800;
  --bav-line-height-tight: 1.25;
  --bav-line-height-normal: 1.6;

  /* -- Spacing -- */
  --bav-space-xs: 0.25rem;
  --bav-space-sm: 0.5rem;
  --bav-space-md: 1rem;
  --bav-space-lg: 1.5rem;
  --bav-space-xl: 2rem;
  --bav-space-2xl: 3rem;
  --bav-space-3xl: 4rem;

  /* -- Border & Shape -- */
  --bav-radius-none: 0;
  --bav-radius-sm: 0;
  --bav-radius-md: 0;
  --bav-radius-lg: 0;
  --bav-radius-circle: 50%;
  --bav-border-width: 1px;
  --bav-shadow-sm: 0 1px 3px rgba(26, 33, 80, 0.08);
  --bav-shadow-md: 0 4px 8px rgba(26, 33, 80, 0.1);
  --bav-shadow-lg: 0 12px 32px rgba(26, 33, 80, 0.12);

  /* -- Transitions -- */
  --bav-transition-fast: 150ms ease;
  --bav-transition-normal: 250ms ease;
  --bav-transition-slow: 400ms ease;

  /* -- Focus & Accessibility -- */
  --bav-focus-ring: 0 0 0 3px var(--bav-border-focus);
  --bav-focus-offset: 2px;

  /* -- Breakpoint Reference (documentation only — not usable in @media) -- */
  --bav-bp-sm: 576px;
  --bav-bp-md: 768px;
  --bav-bp-lg: 992px;
  --bav-bp-xl: 1200px;
  --bav-bp-xxl: 1400px;
}

/* ==========================================================================
   Shared Base Styles
   ========================================================================== */

/* -- Skip Link (WCAG 2.1 AA — first focusable element) -- */
.bav-skip-link {
  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;
}

.bav-skip-link:focus {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: auto !important;
  height: auto !important;
  padding: var(--bav-space-sm) var(--bav-space-md) !important;
  margin: 0 !important;
  overflow: visible !important;
  clip: auto !important;
  white-space: normal !important;
  background: var(--bav-primary);
  color: var(--bav-text-inverse);
  z-index: 10000;
  font-family: var(--bav-font-family);
  font-size: var(--bav-font-size-sm);
  font-weight: var(--bav-font-weight-semibold);
  text-decoration: none;
  outline: none;
  box-shadow: var(--bav-focus-ring);
}

/* -- Focus Ring Utility — applies to all BAV interactive elements -- */
[data-bav-feedback]:focus-visible,
[data-bav-consent]:focus-visible,
[data-bav-newsletter]:focus-visible,
[data-bav-contact]:focus-visible,
[data-bav-seller]:focus-visible,
[data-bav-toast]:focus-visible,
[data-bav-favorites]:focus-visible,
[data-bav-card-flag]:focus-visible {
  outline: none;
  box-shadow: var(--bav-focus-ring);
}

/* -- Reduced Motion Override -- */
@media (prefers-reduced-motion: reduce) {
  :root {
    --bav-transition-fast: 0ms;
    --bav-transition-normal: 0ms;
    --bav-transition-slow: 0ms;
  }

  .bav-skeleton {
    animation: none;
  }
}

/* -- Skeleton Loading Animation -- */
@keyframes bav-pulse {
  0%, 100% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
}

.bav-skeleton {
  background-color: var(--bav-bg-surface);
  animation: bav-pulse 1.5s ease-in-out infinite;
}
