/* ============================================================
   DESIGN SYSTEM — QüeryFull NeX / WebIA
   Variables, Reset, Tipografía, Utilidades
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* --- CSS Custom Properties --- */
:root {
  /* Primary palette */
  --primary:          #1a3fc7;
  --primary-dark:     #0f2a8a;
  --primary-darker:   #0a1d66;
  --primary-light:    #e8edff;
  --primary-lighter:  #f0f4ff;

  /* Accents */
  --accent-green:     #15803d;
  --accent-green-bg:  #dcfce7;
  --accent-red:       #ef4444;
  --accent-red-bg:    #fee2e2;
  --accent-yellow:    #f59e0b;
  --accent-yellow-bg: #fef3c7;
  --accent-blue:      #3b82f6;
  --accent-blue-bg:   #dbeafe;

  /* Backgrounds */
  --bg-body:          #f5f7fb;
  --bg-card:          #ffffff;
  --bg-chat:          #f0f4ff;
  --bg-chat-user:     #e8edff;
  --bg-header:        #1a3fc7;
  --bg-sidebar:       #0a1d66;

  /* Text */
  --text-primary:     #1e293b;
  --text-secondary:   #64748b;
  --text-muted:       #94a3b8;
  --text-inverse:     #ffffff;
  --text-price:       #1e293b;
  --text-price-old:   #94a3b8;
  --text-price-sale:  #ef4444;

  /* Borders */
  --border:           #e2e8f0;
  --border-light:     #f1f5f9;
  --border-focus:     #1a3fc7;

  /* Shadows */
  --shadow-sm:        0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:        0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg:        0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl:        0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.05);
  --shadow-card:      0 2px 8px rgba(0,0,0,0.06);
  --shadow-card-hover:0 8px 24px rgba(26,63,199,0.12);

  /* Radius */
  --radius-sm:        6px;
  --radius-md:        10px;
  --radius-lg:        14px;
  --radius-xl:        20px;
  --radius-full:      9999px;

  /* Spacing scale */
  --space-1:   4px;
  --space-2:   8px;
  --space-3:   12px;
  --space-4:   16px;
  --space-5:   20px;
  --space-6:   24px;
  --space-8:   32px;
  --space-10:  40px;
  --space-12:  48px;
  --space-16:  64px;

  /* Typography */
  --font-family:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-xs:          0.75rem;     /* 12px */
  --font-sm:          0.8125rem;   /* 13px */
  --font-base:        0.875rem;    /* 14px */
  --font-md:          1rem;        /* 16px */
  --font-lg:          1.125rem;    /* 18px */
  --font-xl:          1.25rem;     /* 20px */
  --font-2xl:         1.5rem;      /* 24px */
  --font-3xl:         2rem;        /* 32px */

  /* Line height */
  --leading-tight:    1.25;
  --leading-normal:   1.5;
  --leading-relaxed:  1.625;

  /* Transitions */
  --transition-fast:  150ms ease;
  --transition-base:  250ms ease;
  --transition-slow:  400ms ease;
  --transition-spring: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-index layers */
  --z-dropdown:   100;
  --z-sticky:     200;
  --z-fixed:      300;
  --z-modal:      400;
  --z-toast:      500;

  /* Layout widths */
  --header-height:    64px;
  --footer-height:    60px;
  --sidebar-width:    280px;
  --cart-width:       340px;
  --mobile-nav-height: 60px;
}


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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

img, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
  transition: all var(--transition-fast);
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: var(--leading-tight);
  color: var(--text-primary);
}


/* --- Utility Classes --- */

/* Flexbox */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

/* Text */
.text-xs { font-size: var(--font-xs); }
.text-sm { font-size: var(--font-sm); }
.text-base { font-size: var(--font-base); }
.text-md { font-size: var(--font-md); }
.text-lg { font-size: var(--font-lg); }
.text-xl { font-size: var(--font-xl); }
.text-2xl { font-size: var(--font-2xl); }
.text-3xl { font-size: var(--font-3xl); }
.font-regular { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-white { color: var(--text-inverse); }
.text-primary { color: var(--primary); }
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Spacing */
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }

/* Display */
.hidden { display: none !important; }
.block { display: block; }
.inline-flex { display: inline-flex; }
.relative { position: relative; }
.absolute { position: absolute; }
.sticky { position: sticky; }
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

/* Misc */
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-card { box-shadow: var(--shadow-card); }
.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }


/* --- Scrollbar Styling --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}


/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(100%); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

@keyframes typing {
  0%   { opacity: 0.3; }
  50%  { opacity: 1; }
  100% { opacity: 0.3; }
}

@keyframes cartBadgePop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.animate-fade-in     { animation: fadeIn var(--transition-base) both; }
.animate-fade-in-up  { animation: fadeInUp var(--transition-base) both; }
.animate-slide-right { animation: slideInRight var(--transition-base) both; }
.animate-slide-left  { animation: slideInLeft var(--transition-base) both; }
.animate-slide-up    { animation: slideUp var(--transition-slow) both; }
.animate-scale-in    { animation: scaleIn var(--transition-spring) both; }
.animate-pulse       { animation: pulse 1.5s ease-in-out infinite; }
