/**
 * common.css — Variables globales y reset base
 *
 * Sistema de diseño:
 * - Colores cálidos para restauración (no fríos/corporativos)
 * - Tipografía grande y legible (pensada para pantallas de cocina y móviles)
 * - Espaciado generoso para touch targets (mínimo 44px)
 * - Animaciones sutiles para feedback inmediato
 */

:root {
  /* Colores principales */
  --color-primary: #2D6A4F;
  --color-primary-light: #40916C;
  --color-primary-dark: #1B4332;
  --color-accent: #E76F51;
  --color-accent-light: #F4A261;

  /* Estados */
  --color-success: #2D6A4F;
  --color-warning: #E9C46A;
  --color-danger: #E63946;
  --color-info: #457B9D;

  /* Neutros */
  --color-bg: #FAFAF5;
  --color-surface: #FFFFFF;
  --color-text: #1D3557;
  --color-text-secondary: #6C757D;
  --color-border: #DEE2E6;
  --color-border-light: #F0F0EB;

  /* Sombras */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);

  /* Bordes */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 999px;

  /* Tipografía */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2rem;

  /* Transiciones */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-family);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

input, textarea {
  font-family: inherit;
  font-size: var(--font-size-base);
}

/* Utilidades */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}

/* Animaciones */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

.fade-in {
  animation: fadeIn 0.3s ease;
}

.slide-up {
  animation: slideUp 0.35s ease;
}

/* Toast / Notificaciones */
.toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--color-text);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: 500;
  animation: fadeIn 0.3s ease;
  pointer-events: auto;
  text-align: center;
  max-width: 90vw;
}

.toast--success { background: var(--color-success); }
.toast--error { background: var(--color-danger); }
.toast--warning { background: var(--color-warning); color: var(--color-text); }

/* Loader */
.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.loader::after {
  content: '';
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 700;
  line-height: 1;
}

.badge--primary {
  background: var(--color-primary);
  color: white;
}

.badge--danger {
  background: var(--color-danger);
  color: white;
}

.badge--warning {
  background: var(--color-warning);
  color: var(--color-text);
}
