/* ===========================================
   BASE.CSS - Reset + Variables Globales
   Lydent - Mobile-First Foundation
   =========================================== */

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

/* Variables CSS */
:root {
    /* Paleta de colores */
    --vevi-green: #89a02c;
    --vevi-green-dark: #6d8023;
    --vevi-green-light: #f4f7e9;
    --vevi-green-lighter: #f9faf4;
    
    /* Textos */
    --text-dark: #333;
    --text-secondary: #666;
    --text-muted: #6c757d;
    
    /* Fondos */
    --bg-white: #fff;
    --bg-light: #f8f9fa;
    --bg-body: #f5f5f5;
    
    /* Bordes */
    --border-color: #e0e0e0;
    --border-light: #eee;
    
    /* Estados */
    --color-success: #0f5132;
    --color-success-bg: #d1e7dd;
    --color-error: #842029;
    --color-error-bg: #f8d7da;
    --color-warning: #664d03;
    --color-warning-bg: #fff3cd;
    --color-info: #055160;
    --color-info-bg: #cff4fc;
    
    /* Espaciado (escala consistente) */
    --space-xs: 0.25rem;   /* 4px */
    --space-sm: 0.5rem;    /* 8px */
    --space-md: 1rem;      /* 16px */
    --space-lg: 1.5rem;    /* 24px */
    --space-xl: 2rem;      /* 32px */
    
    /* Touch targets mínimos (accesibilidad) */
    --touch-min: 44px;
    
    /* Radios */
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;
    
    /* Sombras */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.15);
    
    /* Transiciones */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    
    /* Sidebar */
    --sidebar-width: 240px;

    /* Sidebar Universal */
    --sidebar-universal-width: 280px;

    /* Z-index hierarchy */
    --z-sticky: 100;
    --z-sidebar-overlay: 250;
    --z-sidebar: 300;
    --z-dropdown: 400;

    /* Header */
    --header-height: 56px;

    /* Action Bar */
    --action-bar-height: 48px;

    /* Breakpoints (solo documentacion, CSS no soporta variables en media queries) */
    /* --bp-sm: 576px; */
    /* --bp-md: 768px; */
    /* --bp-lg: 1024px; */
    /* --bp-xl: 1280px; */
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-body);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Focus visible para accesibilidad (navegación por teclado) */
:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--vevi-green);
    outline-offset: 2px;
}

/* Links base */
a {
    color: var(--vevi-green);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

/* Skip link para accesibilidad */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-md);
    background: var(--vevi-green);
    color: white;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius);
    z-index: 9999;
    font-weight: 600;
}

.skip-link:focus {
    top: var(--space-md);
    color: white;
}

/* Utilidades */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Container genérico */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

@media (min-width: 768px) {
    .container {
        padding: 0 var(--space-lg);
    }
}

/* ===========================================
   SKIP LINK (Accesibilidad)
   =========================================== */

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--vevi-green);
    color: var(--bg-white);
    padding: var(--space-sm) var(--space-md);
    z-index: 9999;
    text-decoration: none;
    font-weight: 500;
    border-radius: 0 0 var(--radius-sm) 0;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
}
