/* ============================================
   PORTFOLIO MANUEL CAMPOS - BASE.CSS
   Variables, Reset, Contenedor, Navegacion
   ============================================ */

/* ============================================
   VARIABLES CSS
   ============================================ */
:root {
    /* Colores */
    --color-bg: #FAFBFC;
    --color-surface-accent: #F0F4FF;
    --color-text: #1A1D23;
    --color-text-light: #5F6C7B;
    --color-primary: #0066FF;
    --color-primary-dark: #0052CC;
    --color-border: #E1E4E8;
    --color-white: #FFFFFF;
    --color-accent: #00D4AA;
    --color-warning: #FF6B35;

    /* Tipografía */
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-heading: 'Archivo', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: 'JetBrains Mono', "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, monospace;

    /* Easing */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --dur-slow: 500ms;

    /* Espaciado */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-xxl: 4rem;

    /* Radio de borde */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

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

    /* Transiciones — propiedades explícitas para no animar layout */
    --transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease,
                  box-shadow 0.2s ease, opacity 0.2s ease,
                  transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   RESET Y BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@media (max-width: 768px) {
    body {
        line-height: 1.55;
    }
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

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

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

ul {
    list-style: none;
}

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

/* ============================================
   CONTENEDOR PRINCIPAL
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

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

/* ============================================
   NAVEGACIÓN
   ============================================ */
.nav-main {
    background-color: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-sm);
    padding-bottom: var(--space-sm);
}

.logo {
    display: flex;
    align-items: center;
    z-index: 1002;
    position: relative;
    line-height: 0;
}

.logo:hover {
    opacity: 0.8;
}

.logo-full {
    display: none !important; /* Always hide full logo to show only the chip */
}

.logo-chip {
    display: block !important;
    height: 38px;
    width: auto;
}

@media (max-width: 768px) {
    .logo-chip {
        height: 32px;
    }
}

.nav-toggle {
    display: none; /* Oculto por defecto en desktop */
    position: relative;
    z-index: 1002;
}

.nav-menu {
    display: flex;
    gap: var(--space-md);
    align-items: center;
}

.nav-menu li a {
    color: var(--color-text);
    font-size: 0.95rem;
    font-weight: 500;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-menu li a:hover:not(.btn-download),
.nav-menu li a.active {
    color: var(--color-primary);
    background-color: rgba(0, 102, 255, 0.08);
}

.btn-download {
    background-color: var(--color-primary);
    color: var(--color-white) !important;
    padding: var(--space-xs) var(--space-md) !important;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
}

.btn-download:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-1px);
}

/* Selector de idioma */
.language-selector {
    display: flex;
    gap: var(--space-md);
    align-items: center;
    padding: 0;
    margin-left: var(--space-md);
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    padding-left: var(--space-md);
}

.lang-link {
    padding: 4px 8px;
    border-radius: var(--radius-md);
    transition: var(--transition);
    opacity: 0.7;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    background-color: transparent;
    text-decoration: none;
}

.flag-icon {
    width: 32px; /* Tamaño de bandera en desktop */
    height: 32px;
    border-radius: 4px;
    display: block;
    object-fit: cover;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.lang-link:hover {
    opacity: 1;
    background-color: transparent;
    transform: scale(1.15);
    cursor: pointer;
}

.lang-link:hover .flag-icon {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.lang-link.active-lang {
    opacity: 1;
    background-color: transparent;
    transform: scale(1.05);
}

.lang-link.active-lang .flag-icon {
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.4);
    border: 2px solid rgba(0, 102, 255, 0.3);
}

@media (max-width: 768px) {
    .nav-container {
        flex-wrap: nowrap;
        padding: var(--space-sm);
    }
    
    
    .nav-toggle {
        display: flex; /* Mostrar en móvil */
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background-color: var(--color-white);
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 30px 30px 30px;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        gap: 0;
        z-index: 1001; /* Por encima del overlay */
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-menu li {
        width: 100%;
        margin-bottom: var(--space-sm);
    }
    
    .nav-menu li a {
        display: block;
        width: 100%;
        padding: var(--space-sm) var(--space-md);
        font-size: 1rem;
        color: var(--color-text);
        background-color: transparent;
    }
    
    .nav-menu li a:hover:not(.btn-download),
    .nav-menu li a.active {
        color: var(--color-primary);
        background-color: rgba(0, 102, 255, 0.08);
    }
    
    .btn-download {
        width: 100%;
        text-align: center;
        padding: var(--space-md) !important;
        font-size: 1rem !important;
        margin-top: var(--space-md);
        background-color: var(--color-primary) !important;
        color: var(--color-white) !important;
    }
    
    /* Selector de idioma en móvil */
    .language-selector {
        width: 100%;
        justify-content: center;
        padding: var(--space-lg) 0 0 0;
        margin-top: var(--space-md);
        margin-left: 0;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        border-left: none;
        gap: var(--space-xl);
        background-color: transparent;
    }
    
    .lang-link {
        padding: 8px;
        background-color: transparent;
        border-radius: var(--radius-lg);
    }

    .flag-icon {
        width: 48px;
        height: 48px;
        border-radius: var(--radius-md);
    }
    
    .lang-link:hover {
        background-color: transparent;
        transform: scale(1.2);
    }
    
    .lang-link:hover .flag-icon {
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
    }
    
    .lang-link.active-lang {
        background-color: transparent;
        transform: scale(1.1);
    }
    
    .lang-link.active-lang .flag-icon {
        box-shadow: 0 6px 16px rgba(0, 102, 255, 0.5);
        border: 3px solid rgba(0, 102, 255, 0.4);
    }
    
    /* Hamburger menu */
    .nav-toggle {
        display: flex;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
        z-index: 1002; /* Por encima de todo */
        padding: 5px;
        position: relative;
    }
    
    .nav-toggle span {
        width: 25px;
        height: 3px;
        background-color: var(--color-text);
        border-radius: 3px;
        transition: var(--transition);
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(7px, 7px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }
    
    /* Overlay para cerrar menu */
    .nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1000; /* Debajo del menú */
    }

    .nav-overlay.active {
        display: block;
    }
}

/* Visually hidden — accesible para lectores de pantalla, invisible visualmente */
.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;
}

