/* =====================================================
   TOKENS DE DISEÑO - Sistema Visual Unificado Mercana
   Sprint 2: Sistema Visual Unificado

   Este archivo contiene TODAS las variables CSS del proyecto.
   NO definir variables :root en otros archivos CSS.
   ===================================================== */

:root {
  /* =====================================================
     COLORES PRIMARIOS
     ===================================================== */
  --color-primary: #667eea;
  --color-primary-dark: #5a52e0;
  --color-primary-light: #818cf8;
  --color-primary-rgb: 102, 126, 234;

  /* =====================================================
     COLORES SECUNDARIOS
     ===================================================== */
  --color-secondary: #f59e0b;
  --color-secondary-dark: #d97706;
  --color-secondary-light: #fbbf24;
  --color-secondary-rgb: 245, 158, 11;

  /* =====================================================
     COLORES DE ACENTO
     ===================================================== */
  --color-accent: #10b981;
  --color-accent-dark: #059669;
  --color-accent-light: #34d399;

  /* =====================================================
     COLORES SEMANTICOS
     ===================================================== */
  --color-success: #10b981;
  --color-success-light: #d1fae5;
  --color-warning: #f59e0b;
  --color-warning-light: #fef3c7;
  --color-error: #ef4444;
  --color-error-light: #fee2e2;
  --color-info: #3b82f6;
  --color-info-light: #dbeafe;

  /* =====================================================
     ESCALA DE GRISES (Neutrales)
     ===================================================== */
  --color-gray-50: #f8fafc;
  --color-gray-100: #f1f5f9;
  --color-gray-200: #e2e8f0;
  --color-gray-300: #cbd5e1;
  --color-gray-400: #94a3b8;
  --color-gray-500: #64748b;
  --color-gray-600: #475569;
  --color-gray-700: #334155;
  --color-gray-800: #1e293b;
  --color-gray-900: #0f172a;

  /* =====================================================
     COLORES DE FONDO
     ===================================================== */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-dark: #0f172a;
  --bg-dark-secondary: #1e293b;

  /* =====================================================
     COLORES DE TEXTO
     ===================================================== */
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-light: #cbd5e1;
  --text-inverse: #ffffff;

  /* =====================================================
     GRADIENTES
     ===================================================== */
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-secondary: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --gradient-accent: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --gradient-dark: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

  /* =====================================================
     TIPOGRAFIA
     ===================================================== */
  /* Familias tipograficas */
  --font-display: 'Lexend Giga', system-ui, sans-serif;
  --font-body: 'Inter', 'Poppins', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Tamanos de fuente */
  --text-xs: 0.75rem;     /* 12px */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg: 1.125rem;    /* 18px */
  --text-xl: 1.25rem;     /* 20px */
  --text-2xl: 1.5rem;     /* 24px */
  --text-3xl: 1.875rem;   /* 30px */
  --text-4xl: 2.25rem;    /* 36px */
  --text-5xl: 3rem;       /* 48px */

  /* Pesos tipograficos */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;

  /* Altura de linea */
  --leading-none: 1;
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;

  /* Espaciado entre letras */
  --tracking-tighter: -0.05em;
  --tracking-tight: -0.025em;
  --tracking-normal: 0em;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.05em;
  --tracking-widest: 0.1em;

  /* =====================================================
     ESPACIADO
     ===================================================== */
  --spacing-0: 0;
  --spacing-px: 1px;
  --spacing-0-5: 0.125rem;  /* 2px */
  --spacing-1: 0.25rem;     /* 4px */
  --spacing-1-5: 0.375rem;  /* 6px */
  --spacing-2: 0.5rem;      /* 8px */
  --spacing-2-5: 0.625rem;  /* 10px */
  --spacing-3: 0.75rem;     /* 12px */
  --spacing-3-5: 0.875rem;  /* 14px */
  --spacing-4: 1rem;        /* 16px */
  --spacing-5: 1.25rem;     /* 20px */
  --spacing-6: 1.5rem;      /* 24px */
  --spacing-7: 1.75rem;     /* 28px */
  --spacing-8: 2rem;        /* 32px */
  --spacing-9: 2.25rem;     /* 36px */
  --spacing-10: 2.5rem;     /* 40px */
  --spacing-12: 3rem;       /* 48px */
  --spacing-14: 3.5rem;     /* 56px */
  --spacing-16: 4rem;       /* 64px */
  --spacing-20: 5rem;       /* 80px */
  --spacing-24: 6rem;       /* 96px */

  /* =====================================================
     BORDES
     ===================================================== */
  /* Radios */
  --radius-none: 0;
  --radius-sm: 0.25rem;     /* 4px */
  --radius-md: 0.375rem;    /* 6px */
  --radius-DEFAULT: 0.5rem; /* 8px */
  --radius-lg: 0.75rem;     /* 12px */
  --radius-xl: 1rem;        /* 16px */
  --radius-2xl: 1.5rem;     /* 24px */
  --radius-3xl: 2rem;       /* 32px */
  --radius-full: 9999px;

  /* Anchos de borde */
  --border-0: 0;
  --border-1: 1px;
  --border-2: 2px;
  --border-4: 4px;
  --border-8: 8px;

  /* =====================================================
     SOMBRAS
     ===================================================== */
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
  --shadow-none: 0 0 #0000;

  /* Sombras con color */
  --shadow-primary: 0 4px 14px 0 rgba(102, 126, 234, 0.39);
  --shadow-secondary: 0 4px 14px 0 rgba(245, 158, 11, 0.39);
  --shadow-accent: 0 4px 14px 0 rgba(16, 185, 129, 0.39);

  /* =====================================================
     TRANSICIONES
     ===================================================== */
  --transition-none: none;
  --transition-all: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-colors: color 150ms cubic-bezier(0.4, 0, 0.2, 1),
                       background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
                       border-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-opacity: opacity 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-shadow: box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-transform: transform 150ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Easing functions */
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* =====================================================
     Z-INDEX
     ===================================================== */
  --z-0: 0;
  --z-10: 10;
  --z-20: 20;
  --z-30: 30;
  --z-40: 40;
  --z-50: 50;
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
  --z-toast: 1080;

  /* =====================================================
     BREAKPOINTS (para referencia en JS)
     ===================================================== */
  --breakpoint-sm: 576px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 992px;
  --breakpoint-xl: 1200px;
  --breakpoint-xxl: 1400px;

  /* =====================================================
     COMPONENTES - Valores especificos
     ===================================================== */

  /* Navbar */
  --navbar-height: 70px;
  --navbar-bg: var(--gradient-dark);

  /* Cards */
  --card-bg: var(--bg-primary);
  --card-border: var(--color-gray-200);
  --card-radius: var(--radius-2xl);
  --card-shadow: var(--shadow-sm);
  --card-shadow-hover: var(--shadow-xl);

  /* Buttons */
  --btn-radius: var(--radius-full);
  --btn-padding-x: var(--spacing-6);
  --btn-padding-y: var(--spacing-3);
  --btn-font-weight: var(--font-semibold);

  /* Inputs */
  --input-radius: var(--radius-full);
  --input-border: var(--color-gray-300);
  --input-focus-ring: rgba(102, 126, 234, 0.25);

  /* Footer */
  --footer-bg: var(--gradient-dark);
  --footer-text: var(--text-inverse);

  /* =====================================================
     LEGACY ALIASES (para compatibilidad)
     Usar los nuevos nombres en codigo nuevo
     ===================================================== */
  --primary: var(--color-primary);
  --secondary: var(--color-secondary);
  --accent: var(--color-accent);
  --success: var(--color-success);
  --danger: var(--color-error);
  --warning: var(--color-warning);
  --info: var(--color-info);
  --dark: var(--color-gray-800);
  --light: var(--color-gray-100);
  --bg-light: var(--bg-secondary);
  --bg-white: var(--bg-primary);
  --text-dark: var(--text-primary);
  --text-muted: var(--text-secondary);
  --detail: var(--color-secondary-light);

  /* Gradientes legacy */
  --primary-gradient: var(--gradient-primary);
  --secondary-gradient: var(--gradient-secondary);
  --accent-gradient: var(--gradient-accent);

  /* Colores de plataforma legacy */
  --primary-color: var(--color-primary);
  --secondary-color: var(--color-secondary);
  --accent-color: var(--color-accent);
}

/* =====================================================
   TIPOGRAFIA BASE
   ===================================================== */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Titulos con fuente display */
h1, .h1,
h2, .h2 {
  font-family: var(--font-display);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  color: var(--text-primary);
}

h3, .h3,
h4, .h4,
h5, .h5,
h6, .h6 {
  font-family: var(--font-body);
  font-weight: var(--font-semibold);
  line-height: var(--leading-snug);
  color: var(--text-primary);
}

h1, .h1 { font-size: var(--text-4xl); }
h2, .h2 { font-size: var(--text-3xl); }
h3, .h3 { font-size: var(--text-2xl); }
h4, .h4 { font-size: var(--text-xl); }
h5, .h5 { font-size: var(--text-lg); }
h6, .h6 { font-size: var(--text-base); }

/* =====================================================
   UTILIDADES DE COLOR
   ===================================================== */
.text-primary { color: var(--color-primary) !important; }
.text-secondary { color: var(--color-secondary) !important; }
.text-accent { color: var(--color-accent) !important; }
.text-success { color: var(--color-success) !important; }
.text-warning { color: var(--color-warning) !important; }
.text-error { color: var(--color-error) !important; }
.text-muted { color: var(--text-secondary) !important; }

.bg-primary { background-color: var(--color-primary) !important; }
.bg-secondary { background-color: var(--color-secondary) !important; }
.bg-accent { background-color: var(--color-accent) !important; }
.bg-light { background-color: var(--bg-secondary) !important; }
.bg-dark { background-color: var(--bg-dark) !important; }

/* Texto con gradiente */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
