/* ===================================
   VerLaRuta - Estilos principales
   =================================== */

/* Variables */
:root {
    --verde-montana: #2d5a27;
    --verde-claro: #4a7c43;
    --azul-cielo: #4a90a4;
    --azul-oscuro: #2c5f6e;
    --blanco: #ffffff;
    --gris-claro: #f5f7f9;
    --gris-medio: #6b7280;
    --gris-oscuro: #333333;
    --negro: #1a1a1a;
    --rojo-alerta: #dc3545;
    --amarillo: #f59e0b;

    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Open Sans', sans-serif;

    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.2);

    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--gris-oscuro);
    background: var(--blanco);
}

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

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

a:hover {
    color: var(--verde-claro);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===================================
   Navegación
   =================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: transparent;
    padding: 20px 0;
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    padding: 12px 0;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
}

.logo-ver {
    color: var(--blanco);
}

.logo-la {
    color: var(--verde-claro);
}

.logo-ruta {
    color: var(--blanco);
}

.navbar.scrolled .logo-ver,
.navbar.scrolled .logo-ruta {
    color: var(--gris-oscuro);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

.nav-link {
    color: var(--blanco);
    font-weight: 600;
    font-size: 0.95rem;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--verde-claro);
    transition: var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

.navbar.scrolled .nav-link {
    color: var(--gris-oscuro);
}

.navbar.scrolled .nav-link:hover {
    color: var(--verde-montana);
}

.lang-switch {
    background: var(--verde-montana);
    color: var(--blanco) !important;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.lang-switch:hover {
    background: var(--verde-claro);
    color: var(--blanco) !important;
}

/* Hamburger */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--blanco);
    border-radius: 2px;
    transition: var(--transition);
}

.navbar.scrolled .nav-toggle span {
    background: var(--gris-oscuro);
}

/* ===================================
   Hero
   =================================== */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    background: url('https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=1920&q=80') center/cover no-repeat;
    color: var(--blanco);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.4) 0%,
        rgba(0, 0, 0, 0.3) 50%,
        rgba(45, 90, 39, 0.6) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 0 20px;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    margin-bottom: 40px;
    opacity: 0.95;
    max-width: 600px;
}

.hero-scroll {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--blanco);
    font-size: 0.9rem;
    opacity: 0.8;
}

.scroll-arrow {
    width: 24px;
    height: 24px;
    border-right: 2px solid var(--blanco);
    border-bottom: 2px solid var(--blanco);
    transform: rotate(45deg);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) rotate(45deg); }
    40% { transform: translateY(10px) rotate(45deg); }
    60% { transform: translateY(5px) rotate(45deg); }
}

/* ===================================
   Buttons
   =================================== */
.btn {
    display: inline-block;
    padding: 14px 32px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--verde-montana);
    color: var(--blanco);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: var(--verde-claro);
    color: var(--blanco);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--blanco);
    color: var(--verde-montana);
    border: 2px solid var(--verde-montana);
}

.btn-secondary:hover {
    background: var(--verde-montana);
    color: var(--blanco);
}

/* ===================================
   Sections
   =================================== */
.section {
    padding: 100px 0;
    position: relative;
}

.section-overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.section .container {
    position: relative;
    z-index: 1;
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 15px;
    color: var(--gris-oscuro);
}

.section-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: var(--gris-medio);
    margin-bottom: 60px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* ===================================
   Contexto
   =================================== */
.section-contexto {
    background: url('https://images.unsplash.com/photo-1519451241324-20b4ea2c4220?w=1920&q=80') center/cover no-repeat fixed;
}

.section-contexto .section-overlay {
    background: rgba(255, 255, 255, 0.92);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.stat-card {
    background: var(--blanco);
    padding: 40px 30px;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--verde-montana);
    margin-bottom: 10px;
}

.stat-label {
    color: var(--gris-medio);
    font-size: 0.95rem;
}

.destinations {
    text-align: center;
}

.destinations h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: var(--gris-oscuro);
}

.destinations-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.destination-tag {
    background: var(--verde-montana);
    color: var(--blanco);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.destination-tag:hover {
    background: var(--verde-claro);
    transform: scale(1.05);
}

/* ===================================
   Problema
   =================================== */
.section-problema {
    background: url('https://images.unsplash.com/photo-1551632811-561732d1e306?w=1920&q=80') center/cover no-repeat fixed;
    color: var(--blanco);
}

.section-problema .section-overlay {
    background: rgba(26, 26, 26, 0.88);
}

.section-problema .section-title,
.section-problema .section-subtitle {
    color: var(--blanco);
}

.section-problema .section-subtitle {
    opacity: 0.9;
}

.problem-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 50px;
    margin-bottom: 50px;
}

.accident-stats h3,
.causes h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin-bottom: 25px;
}

.accident-chart {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    height: 220px;
    padding: 20px 0;
}

.chart-bar {
    flex: 1;
    background: linear-gradient(180deg, var(--verde-claro) 0%, var(--verde-montana) 100%);
    border-radius: 8px 8px 0 0;
    height: calc(var(--height));
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 10px;
    position: relative;
    transition: var(--transition);
}

.chart-bar.highlighted {
    background: linear-gradient(180deg, var(--rojo-alerta) 0%, #b02a37 100%);
}

.chart-bar:hover {
    transform: scaleY(1.05);
    transform-origin: bottom;
}

.bar-value {
    font-weight: 700;
    font-size: 0.85rem;
}

.bar-year {
    position: absolute;
    bottom: -25px;
    font-size: 0.8rem;
    color: var(--gris-medio);
}

.cause-item {
    margin-bottom: 20px;
}

.cause-bar {
    height: 8px;
    background: linear-gradient(90deg, var(--rojo-alerta) 0%, var(--amarillo) 100%);
    border-radius: 4px;
    width: calc(var(--width));
    margin-bottom: 8px;
}

.cause-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cause-percent {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--rojo-alerta);
    min-width: 50px;
}

.cause-text {
    color: rgba(255, 255, 255, 0.9);
}

.problem-quote {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px 40px;
    border-left: 4px solid var(--verde-claro);
    border-radius: 0 12px 12px 0;
    font-style: italic;
    font-size: 1.1rem;
}

.problem-quote cite {
    display: block;
    margin-top: 15px;
    font-style: normal;
    font-size: 0.9rem;
    color: var(--verde-claro);
}

/* ===================================
   Solución
   =================================== */
.section-solucion {
    background: url('https://images.unsplash.com/photo-1464822759023-fed622ff2c3b?w=1920&q=80') center/cover no-repeat fixed;
}

.section-solucion .section-overlay {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(245,247,249,0.95) 100%);
}

.pillars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.pillar-card {
    background: var(--blanco);
    padding: 40px 30px;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.pillar-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.pillar-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 25px;
    background: linear-gradient(135deg, var(--verde-montana) 0%, var(--verde-claro) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pillar-icon svg {
    width: 35px;
    height: 35px;
    color: var(--blanco);
}

.pillar-card h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: var(--gris-oscuro);
}

.pillar-card p {
    color: var(--gris-medio);
    line-height: 1.7;
}

.success-case {
    background: var(--blanco);
    padding: 50px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
}

.success-case h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--gris-oscuro);
}

.success-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 40px;
}

.success-content p {
    flex: 1;
    min-width: 280px;
    color: var(--gris-medio);
    line-height: 1.8;
}

.success-stat {
    text-align: center;
    padding: 30px 40px;
    background: linear-gradient(135deg, var(--verde-montana) 0%, var(--verde-claro) 100%);
    border-radius: 16px;
    color: var(--blanco);
}

.success-number {
    display: block;
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
}

.success-label {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* ===================================
   Cómo Funciona
   =================================== */
.section-funciona {
    background: var(--gris-claro);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.feature-card {
    background: var(--blanco);
    padding: 40px 35px;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.feature-number {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    color: var(--gris-claro);
    position: absolute;
    top: 15px;
    right: 25px;
}

.feature-card h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--verde-montana);
}

.feature-card p {
    color: var(--gris-medio);
    line-height: 1.7;
}

.difficulty-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.diff-tag {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--blanco);
}

.diff-tag.verde { background: #22c55e; }
.diff-tag.azul { background: #3b82f6; }
.diff-tag.rojo { background: #ef4444; }
.diff-tag.negro { background: #1f2937; }

/* ===================================
   Demo
   =================================== */
.section-demo {
    background: linear-gradient(135deg, var(--verde-montana) 0%, var(--azul-oscuro) 100%);
    color: var(--blanco);
}

.section-demo .section-title,
.section-demo .section-subtitle {
    color: var(--blanco);
}

.section-demo .section-subtitle a {
    color: var(--blanco);
    text-decoration: underline;
}

.section-demo .section-subtitle a:hover {
    color: var(--verde-claro);
}

.demo-image {
    text-align: center;
    margin-bottom: 40px;
}

.demo-image img {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.demo-section-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    text-align: center;
    margin: 60px 0 30px;
    color: var(--blanco);
}

.demo-container {
    margin-bottom: 50px;
}

.demo-frame {
    background: var(--blanco);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    aspect-ratio: 16/9;
}

.demo-frame iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.demo-fallback {
    text-align: center;
    margin-top: 20px;
    opacity: 0.9;
}

.demo-fallback p {
    margin-bottom: 15px;
}

.demo-features {
    background: rgba(255, 255, 255, 0.1);
    padding: 40px;
    border-radius: 16px;
    max-width: 600px;
    margin: 0 auto;
}

.demo-features h3 {
    font-family: var(--font-heading);
    margin-bottom: 20px;
}

.demo-features ul {
    list-style: none;
}

.demo-features li {
    padding: 10px 0;
    padding-left: 30px;
    position: relative;
}

.demo-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--verde-claro);
    font-weight: bold;
}

/* ===================================
   Footer
   =================================== */
.footer {
    background: var(--negro);
    color: var(--blanco);
    padding: 80px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 50px;
}

.footer-logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.7);
}

.footer h4 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: var(--blanco);
}

.footer ul {
    list-style: none;
}

.footer ul li {
    margin-bottom: 12px;
}

.footer ul a {
    color: rgba(255, 255, 255, 0.7);
}

.footer ul a:hover {
    color: var(--verde-claro);
}

.footer-contact p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 15px;
}

.footer-email {
    color: var(--verde-claro) !important;
    font-weight: 600;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* ===================================
   Animations
   =================================== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===================================
   Responsive
   =================================== */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--blanco);
        flex-direction: column;
        justify-content: center;
        gap: 25px;
        transition: right 0.3s ease;
        box-shadow: var(--shadow-lg);
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-menu .nav-link {
        color: var(--gris-oscuro);
        font-size: 1.1rem;
    }

    .nav-toggle {
        display: flex;
        z-index: 1001;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .section {
        padding: 70px 0;
    }

    .hero-scroll {
        display: none;
    }

    .problem-content {
        gap: 40px;
    }

    .accident-chart {
        height: 180px;
    }

    .success-case {
        padding: 30px 20px;
    }

    .success-content {
        flex-direction: column;
    }

    .demo-features {
        padding: 25px;
    }

    .footer-content {
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stat-card {
        padding: 25px 15px;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    .pillars-grid,
    .features-grid {
        grid-template-columns: 1fr;
    }

    .difficulty-tags {
        flex-direction: column;
    }
}
