/**
 * Sistema de Diseño - AQPAZ
 * Basado en la identidad visual de Fundación AQ Producciones Constructores de Paz
 */

/* ========================================
   VARIABLES DE DISEÑO (Design Tokens)
   ======================================== */
:root {
    /* Colores Principales - Del Logo */
    --color-primary: #F2854E;        /* Naranja Melocotón "AQ" */
    --color-secondary: #E32C2A;      /* Rojo Intenso "PRODUCCIONES" */
    --color-accent: #C88A36;         /* Dorado/Bronce (El Ave) */
    
    /* Colores de Texto */
    --color-text-primary: #8A4A24;   /* Marrón Tierra (Títulos) */
    --color-text-secondary: #333333; /* Gris Carbón (Párrafos) */
    --color-text-light: #666666;     /* Gris medio */
    --color-text-muted: #999999;     /* Gris claro */
    
    /* Colores de Fondo */
    --color-bg-primary: #FFFFFF;     /* Blanco puro */
    --color-bg-secondary: #FFFDF9;   /* Crema muy suave */
    --color-bg-tertiary: #F9F5F0;    /* Crema ligeramente más oscuro */
    
    /* Colores de Borde */
    --color-border: #E8E0D8;         /* Beige claro */
    --color-border-light: #F5F0E8;   /* Beige muy claro */
    
    /* Degradados */
    --gradient-primary: linear-gradient(135deg, #F2854E 0%, #E32C2A 100%);
    --gradient-accent: linear-gradient(135deg, #C88A36 0%, #F2854E 100%);
    --gradient-hero: linear-gradient(135deg, #FFFDF9 0%, #F9F5F0 100%);
    
    /* Sombras */
    --shadow-sm: 0 2px 4px rgba(138, 74, 36, 0.05);
    --shadow-md: 0 4px 12px rgba(138, 74, 36, 0.1);
    --shadow-lg: 0 8px 24px rgba(138, 74, 36, 0.15);
    --shadow-xl: 0 16px 48px rgba(138, 74, 36, 0.2);
    
    /* Bordes */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* Tipografía */
    --font-serif: 'Playfair Display', 'Merriweather', Georgia, serif;
    --font-sans: 'Montserrat', 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Transiciones */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Espaciado */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
}

/* ========================================
   RESET Y BASE
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text-secondary);
    background-color: var(--color-bg-primary);
    line-height: 1.7;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    color: var(--color-text-primary);
    font-weight: 700;
    line-height: 1.3;
}

p {
    color: var(--color-text-secondary);
    line-height: 1.8;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-secondary);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========================================
   HEADER / NAVBAR
   ======================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--color-bg-primary);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: all var(--transition-normal);
}

.header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.logo img {
    height: 50px;
    width: auto;
}

.logo-icon {
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 800;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    color: var(--color-text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding: 0.5rem 0;
    transition: color var(--transition-fast);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: width var(--transition-normal);
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--color-primary);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

.nav-cta {
    background: var(--gradient-primary);
    color: white !important;
    padding: 0.75rem 1.5rem !important;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.nav-cta:hover {
    background: var(--color-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.nav-cta::after {
    display: none !important;
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-text-primary);
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: var(--color-bg-primary);
        flex-direction: column;
        padding: 2rem;
        transition: left var(--transition-normal);
        box-shadow: var(--shadow-lg);
    }
    
    .nav-menu.active {
        left: 0;
    }
}

/* ========================================
   BOTONES
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all var(--transition-normal);
    border: none;
    cursor: pointer;
    font-family: var(--font-sans);
}

/* Botón Principal - Naranja */
.btn-primary {
    background: var(--color-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--color-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: white;
}

/* Botón Secundario - Dorado/Ghost */
.btn-secondary {
    background: transparent;
    color: var(--color-accent);
    border: 2px solid var(--color-accent);
}

.btn-secondary:hover {
    background: var(--color-accent);
    color: white;
    transform: translateY(-2px);
}

/* Botón Blanco */
.btn-white {
    background: white;
    color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

.btn-white:hover {
    background: var(--color-bg-secondary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    color: var(--color-secondary);
}

/* Botón Outline */
.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-outline:hover {
    background: var(--color-primary);
    color: white;
}

/* Botón Grande */
.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.05rem;
}

/* Botón Pequeño */
.btn-sm {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
}

/* ========================================
   SECCIONES
   ======================================== */
.section {
    padding: var(--space-2xl) var(--space-md);
    position: relative;
}

.section-alt {
    background: var(--color-bg-secondary);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.section-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: var(--space-sm);
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
}

.section-subtitle {
    font-size: 1.15rem;
    color: var(--color-text-light);
    max-width: 700px;
    margin: var(--space-md) auto 0;
    line-height: 1.7;
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-hero);
    overflow: hidden;
    padding: var(--space-2xl) var(--space-md);
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23F2854E' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(242, 133, 78, 0.1);
    border: 1px solid var(--color-primary);
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: var(--space-md);
}

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    color: var(--color-text-primary);
    margin-bottom: var(--space-md);
    line-height: 1.2;
}

.hero-title .highlight {
    color: var(--color-primary);
    position: relative;
    display: inline-block;
}

.hero-title .highlight::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 8px;
    background: rgba(242, 133, 78, 0.2);
    z-index: -1;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xl);
    line-height: 1.7;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
}

.hero-image {
    position: absolute;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    width: 400px;
    opacity: 0.1;
    z-index: 1;
}

@media (max-width: 968px) {
    .hero-image {
        display: none;
    }
}

/* ========================================
   TARJETAS
   ======================================== */
.card {
    background: var(--color-bg-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-accent);
}

.card-header {
    padding: var(--space-md);
    border-bottom: 1px solid var(--color-border-light);
}

.card-body {
    padding: var(--space-md);
}

.card-footer {
    padding: var(--space-md);
    border-top: 1px solid var(--color-border-light);
    background: var(--color-bg-secondary);
}

/* ========================================
   PROYECTOS
   ======================================== */
.proyectos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-xl);
}

.proyecto-card {
    background: var(--color-bg-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.proyecto-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--color-primary);
}

.proyecto-imagen {
    position: relative;
    height: 240px;
    overflow: hidden;
    background: var(--gradient-primary);
}

.proyecto-imagen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.proyecto-card:hover .proyecto-imagen img {
    transform: scale(1.1);
}

.proyecto-categoria {
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
    background: white;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: var(--shadow-md);
}

.proyecto-contenido {
    padding: var(--space-md);
}

.proyecto-titulo {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: var(--space-sm);
    line-height: 1.3;
}

.proyecto-titulo a {
    color: inherit;
    text-decoration: none;
}

.proyecto-titulo a:hover {
    color: var(--color-primary);
}

.proyecto-descripcion {
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-md);
    font-size: 0.95rem;
}

.proyecto-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-sm);
    border-top: 1px solid var(--color-border-light);
}

.proyecto-fecha {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.proyecto-link {
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: gap var(--transition-fast);
}

.proyecto-link:hover {
    gap: 0.7rem;
    color: var(--color-secondary);
}

/* ========================================
   ESTADÍSTICAS
   ======================================== */
.stats-section {
    background: var(--gradient-primary);
    color: white;
    padding: var(--space-2xl) var(--space-md);
    position: relative;
    overflow: hidden;
}

.stats-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-xl);
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.stat-item {
    text-align: center;
    padding: var(--space-md);
}

.stat-icon {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.75rem;
    margin: 0 auto var(--space-md);
    backdrop-filter: blur(10px);
}

.stat-number {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    font-weight: 800;
    line-height: 1;
    margin-bottom: var(--space-xs);
}

.stat-label {
    font-size: 0.95rem;
    opacity: 0.95;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
    background: var(--color-text-primary);
    color: white;
    padding: var(--space-2xl) var(--space-md) var(--space-md);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-xl);
    max-width: 1400px;
    margin: 0 auto var(--space-xl);
}

.footer-col h4 {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
    color: white;
}

.footer-col p,
.footer-col ul {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: var(--space-xs);
}

.footer-col ul li a {
    color: rgba(255, 255, 255, 0.8);
    transition: color var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-col ul li a:hover {
    color: var(--color-primary);
}

.footer-social {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.footer-social a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all var(--transition-normal);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-social a:hover {
    background: var(--color-primary);
    transform: translateY(-3px);
    border-color: var(--color-primary);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.footer-bottom strong {
    color: var(--color-primary);
}

/* ========================================
   UTILIDADES
   ======================================== */
.text-center { text-align: center; }
.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-secondary); }
.text-accent { color: var(--color-accent); }

.bg-primary { background: var(--color-bg-primary); }
.bg-secondary { background: var(--color-bg-secondary); }
.bg-tertiary { background: var(--color-bg-tertiary); }

.mt-1 { margin-top: var(--space-xs); }
.mt-2 { margin-top: var(--space-sm); }
.mt-3 { margin-top: var(--space-md); }
.mt-4 { margin-top: var(--space-lg); }
.mt-5 { margin-top: var(--space-xl); }

.mb-1 { margin-bottom: var(--space-xs); }
.mb-2 { margin-bottom: var(--space-sm); }
.mb-3 { margin-bottom: var(--space-md); }
.mb-4 { margin-bottom: var(--space-lg); }
.mb-5 { margin-bottom: var(--space-xl); }

/* ========================================
   ANIMACIONES
   ======================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-fade-in-down {
    animation: fadeInDown 0.6s ease forwards;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .section {
        padding: var(--space-xl) var(--space-sm);
    }
    
    .hero {
        min-height: auto;
        padding: var(--space-2xl) var(--space-sm);
    }
    
    .hero-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .btn {
        width: 100%;
    }
    
    .proyectos-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Loader */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-bg-primary);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s, visibility 0.5s;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px 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); }
}