/* ================= VARIABLES & UTILS ================= */
:root {
    --bg-white: #ffffff;
    --bg-black: #050505;
    --bg-light-gray: #f4f6f8;
    --text-black: #111;
    --text-white: #fff;
    --text-gray: #777;
    --accent: #ff3c00;
    --violet-glow: #8a2be2;
    --ease-smooth: cubic-bezier(0.25, 1, 0.5, 1);
    --font-heading: 'Titillium Web', sans-serif;
    --font-primary: 'Inter', sans-serif;
}

body { background: var(--bg-white); color: var(--text-black); font-family: var(--font-primary); overflow-x: hidden; width: 100%; }
.bg-black { background: var(--bg-black); color: var(--text-white); }
.bg-white { background: var(--bg-white); color: var(--text-black); }
.bg-light-gray { background: var(--bg-light-gray); }
.bg-orange-dark { background: #b32a00; color: #fff; }
.bg-orange-brand { background: var(--accent); color: #fff; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-orange { color: var(--accent); }
.text-violet { color: var(--violet-glow); }
.text-black { color: #000; }
.mb-60 { margin-bottom: 60px; }
.mb-40 { margin-bottom: 40px; }
.mb-20 { margin-bottom: 20px; }
.mt-20 { margin-top: 20px; }
.mt-40 { margin-top: 40px; }
.section-pad { padding: 150px 0; }
.relative-z { position: relative; z-index: 5; }

/* FIX IMAGENES */
img { max-width: 100%; height: auto; }

/* TYPOGRAPHY */
h1, h2, h3, h4, .headline-giant, .stat-number, .t-year, .total-number, .year-giant { font-family: var(--font-heading); }

.headline-giant { font-size: 9rem; font-weight: 300; line-height: 0.95; letter-spacing: -4px; margin: 30px 0; text-align: left; }
.headline-lg { font-size: 4rem; font-weight: 300; line-height: 1.1; }
.headline-md { font-size: 2.5rem; font-weight: 600; }
.body-lg { font-size: 1.25rem; line-height: 1.6; font-weight: 300; }
.hero-desc { font-size: 1.6rem; color: rgba(255,255,255,0.7); font-weight: 300; text-align: left; margin-top: 40px; }

/* PILLS & BUTTONS */
.pill-badge { display: inline-block; padding: 6px 14px; border-radius: 50px; font-size: 0.75rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; }
.pill-badge.grey { background: #e5e5e5; color: #555; }
.pill-badge.white-outline { border: 1px solid rgba(255,255,255,0.3);}
.pill-badge.glass-effect { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.15); color: #fff; backdrop-filter: blur(5px); display: inline-flex; align-items: center; align-self: flex-start; margin-bottom: 20px; }
.pill-badge.glass-effect::before { content: ""; width: 6px; height: 6px; background: var(--accent); margin-right: 10px; border-radius: 50%; }
.pill-badge.violet { background: rgba(138, 43, 226, 0.1); color: var(--violet-glow); }
.btn-cta.orange { background: var(--accent); color: #fff; padding: 15px 40px; border-radius: 50px; font-weight: 700; transition: 0.3s; }
.btn-cta.orange:hover { background: #d33200; transform: translateY(-3px); }

/* ANIMATIONS */
.fade-section { opacity: 0; transform: translateY(20px); transition: 0.8s ease; }
.fade-section.visible { opacity: 1; transform: translateY(0); }
.slide-in-left { opacity: 0; transform: translateX(-60px); transition: 1s var(--ease-smooth); }
.slide-in-right { opacity: 0; transform: translateX(60px); transition: 1s var(--ease-smooth); }
.slide-in-up { opacity: 0; transform: translateY(60px); transition: 1s var(--ease-smooth); }
.fade-up { opacity: 0; transform: translateY(30px); animation: fadeUp 1s var(--ease-smooth) forwards; }
.delay-1 { transition-delay: 0.2s; animation-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; animation-delay: 0.4s; }
.delay-3 { transition-delay: 0.6s; animation-delay: 0.6s; }
.is-visible { opacity: 1; transform: translate(0,0); }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

/* SECCIONES ESPECÍFICAS */
.page-intro { position: sticky; top: 0; z-index: 0; background: radial-gradient(circle at 80% 50%, #2f2f2f 0%, #111 60%, #050505 100%); color: #fff; height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.content-layer { position: relative; z-index: 10; background: var(--bg-white); box-shadow: 0 -50px 100px rgba(0,0,0,0.5); }
.hero-glow { position: absolute; top: 50%; right: -10%; width: 900px; height: 900px; background: radial-gradient(circle, rgba(255,255,255,0.02) 0%, transparent 70%); border-radius: 50%; pointer-events: none; z-index: 1; transform: translateY(-50%); }
.scroll-indicator { position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,0.5); font-size: 0.8rem; text-transform: uppercase; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.word-up { display: inline-block; opacity: 0; transform: translateY(80px); filter: blur(10px); animation: revealWord 1.2s cubic-bezier(0.2, 1, 0.3, 1) forwards; animation-delay: var(--d); margin-right: 0.1em; }
@keyframes revealWord { 0% { opacity: 0; transform: translateY(80px); filter: blur(10px); } 100% { opacity: 1; transform: translateY(0); filter: blur(0); } }

.section-overview { position: relative; min-height: 70vh; overflow: hidden; display: flex; align-items: center; padding: 100px 0; }
.overview-bg { position: absolute; top: 0; left: 0; width: 100%; height: 120%; background: url('../images/home/procesador_banner.jpg') no-repeat center center/cover; filter: brightness(0.4); z-index: -1; background-attachment: fixed; }
.overview-grid { display: grid; grid-template-columns: 1fr 1fr; height: 100%; align-items: center; }
.overview-text-col { padding: 40px; }

.stacking-wrapper { position: relative; }
.stack-card { position: sticky; top: 0; height: 100vh; display: flex; align-items: center; justify-content: flex-start; padding: 0 5vw; box-shadow: 0 -10px 40px rgba(0,0,0,0.2); overflow: hidden; }
.stack-content { max-width: 800px; padding-left: 5vw; }
.year-giant { font-size: 8rem; font-weight: 700; opacity: 0.3; line-height: 1; display: block; margin-bottom: 10px; }

.mission-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 80px; align-items: center; }
.headline-mission { font-size: 4.5rem; line-height: 1.1; margin-top: 20px; margin-bottom: 60px; font-weight: 300; }
.mv-container { display: flex; flex-direction: column; gap: 40px; }
.mv-block { display: flex; gap: 25px; }
.mv-line { width: 2px; background-color: var(--accent); position: relative; flex-shrink: 0; }
.mv-content h3 { font-size: 1.8rem; font-weight: 700; margin-bottom: 10px; text-transform: uppercase; }
.image-frame { width: 100%; border-radius: 20px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,0.1); }

/* ================= MAPA (Fixed Layout) ================= */
.map-header { display: flex; flex-direction: column; align-items: center; }
.map-toggle-wrapper { background: #f0f0f0; border-radius: 50px; padding: 5px; display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.map-toggle-btn { background: transparent; border: none; padding: 10px 30px; font-size: 1rem; font-weight: 600; color: #777; cursor: pointer; border-radius: 50px; transition: 0.3s; }
.map-toggle-btn.active { background: #fff; color: #000; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.map-layout { display: grid; grid-template-columns: 350px 1fr; gap: 60px; align-items: flex-start; }
.data-card { background: #fff; padding: 30px; border-radius: 20px; border: 1px solid #eee; }
.stat-number { font-size: 3.5rem; font-weight: 300; line-height: 1; }
.total-orange-box { background: var(--accent); color: #fff; padding: 40px; border-radius: 20px; margin-top: 40px; text-align: center; }
.total-number { font-size: 4rem; font-weight: 700; line-height: 1; margin-bottom: 5px; }

/* MAP CONTAINER LEAFLET (ESTRICTO) */
.map-visual-col { position: relative; width: 100%; height: 500px; } /* Contenedor Padre Relativo */
.map-container-leaflet { 
    width: 100%; 
    height: 100%; 
    border-radius: 30px; 
    overflow: hidden; /* IMPORTANTE: Oculta lo que se salga */
    box-shadow: 0 20px 60px rgba(0,0,0,0.1); 
    background: #eef1f5;
    z-index: 1;
}

/* BOTÓN RESET (POSICIONADO ABSOLUTO DENTRO DE VISUAL COL) */
.map-reset-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background-color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    font-size: 0.85rem;
    font-weight: 700;
    color: #333;
    cursor: pointer;
    z-index: 999; /* Encima del mapa */
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    opacity: 0; 
    pointer-events: none;
    transform: translateY(10px);
}
.map-reset-btn.visible { opacity: 1; pointer-events: all; transform: translateY(0); }
.map-reset-btn:hover { background-color: var(--accent); color: #fff; transform: translateY(-2px); }

/* TOOLTIPS */
.leaflet-tooltip.custom-tooltip {
    background-color: #fff; border: none; border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2); padding: 10px 15px;
    font-family: 'Titillium Web', sans-serif; opacity: 1 !important;
}
.map-tooltip-content { text-align: center; line-height: 1.2; }
.tooltip-num { display: block; font-size: 1.2rem; font-weight: 700; color: var(--accent); margin-bottom: 2px; }
.tooltip-label { display: block; font-size: 0.75rem; font-weight: 600; color: #333; text-transform: uppercase; }

/* OTROS ESTILOS (Panamá, Timeline, etc) */
.panama-intro-grid { max-width: 900px; }
.panama-projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.project-card { background-color: #1a1a1a; border: 1px solid #333; border-radius: 20px; padding: 40px 30px; transition: all 0.4s ease; position: relative; display: flex; flex-direction: column; height: 100%; }
.project-card:hover { background-color: #222; border-color: var(--accent); transform: translateY(-10px); }
.card-header h4 { font-size: 1.5rem; font-weight: 700; margin-bottom: 20px; color: #fff; font-family: var(--font-heading); }
.card-desc { font-size: 0.95rem; color: #aaa; line-height: 1.6; margin-bottom: 30px; }
.stat-row { display: flex; flex-direction: column; gap: 5px; padding: 15px 0; }
.stat-row.border-top { border-top: 1px solid rgba(255,255,255,0.1); }
.stat-label { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; color: #666; letter-spacing: 1px; }
.stat-value { font-size: 1rem; color: #eee; font-weight: 600; }
.progress-bar-bg { width: 100%; height: 6px; background: rgba(255,255,255,0.1); border-radius: 10px; margin-top: 8px; overflow: hidden; }
.progress-bar-fill { height: 100%; background-color: var(--accent); border-radius: 10px; width: 0; transition: width 1.5s ease-out; }

.bg-black-gradient { background: linear-gradient(180deg, #000 0%, #111 100%); color: #fff; padding: 150px 0; }
.timeline-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 80px; position: relative; }
.timeline-sticky-content { position: sticky; top: 150px; text-align: right; }
.timeline-item { border-bottom: 1px solid rgba(255,255,255,0.15); padding: 30px 0; cursor: pointer; transition: 0.3s; }
.timeline-item.active { border-bottom-color: var(--accent); padding-bottom: 40px; }
.t-header { display: flex; align-items: baseline; gap: 30px; flex-wrap: wrap; }
.t-year { font-size: 2.5rem; font-weight: 300; color: #666; }
.t-title { font-size: 2.5rem; font-weight: 600; color: #fff; margin: 0; }
.t-body { max-height: 0; opacity: 0; overflow: hidden; transition: 0.5s; }
.timeline-item.active .t-body { max-height: 500px; opacity: 1; margin-top: 20px; }
.t-content-wrapper { display: flex; align-items: flex-start; gap: 20px; padding-left: 110px; }
.t-image-box { width: 120px; height: 80px; border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.t-image-box img { width: 100%; height: 100%; object-fit: cover; }

.section-leadership { padding: 120px 0; }
.leadership-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 80px; align-items: flex-start; }
.sticky-frame-ceo { position: sticky; top: 120px; width: 100%; border-radius: 20px; overflow: hidden; }
.image-caption { background: #fff; padding: 20px; border-top: 1px solid #eee; font-size: 0.9rem; color: #555; text-align: center; }
.bio-card { background: #fff; border: 1px solid #eee; border-radius: 20px; overflow: hidden; transition: 0.5s; }
.bio-header { display: flex; align-items: center; gap: 20px; padding: 30px; cursor: pointer; }
.bio-content { max-height: 0; opacity: 0; overflow: hidden; transition: 0.8s; background: #fbfbfd; }
.bio-card.active .bio-content { max-height: 1200px; opacity: 1; }
.bio-inner-text { padding: 0 40px 40px 100px; }

.section-gallery { padding: 120px 0; overflow: hidden; }
.gallery-track-wrapper { width: 100%; overflow-x: auto; padding-bottom: 20px; scrollbar-width: none; }
.gallery-track { display: flex; gap: 20px; padding: 0 5vw; width: max-content; }
.gallery-item { width: 400px; height: 300px; border-radius: 16px; overflow: hidden; flex-shrink: 0; }

.section-grow-video { padding: 120px 0; overflow: hidden; background-color: #fff; }
.grow-media-wrapper { position: relative; width: 60vw; height: 70vh; border-radius: 30px; overflow: hidden; margin: 0 auto; box-shadow: 0 30px 60px rgba(0,0,0,0.15); }
.grow-img, #grow-video { width: 100%; height: 100%; object-fit: cover; }
#grow-video { display: block; }
.caption-text { color: #000; font-weight: 500; font-size: 1.1rem; }

.section-award-light { padding: 150px 0; background: #f8f9fa; overflow: hidden; }
.award-grid-light { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }
.headline-light-huge { font-size: 5rem; line-height: 1; }
.btn-group-center { display: flex; gap: 30px; justify-content: center; align-items: center; }
.violet-aura { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 350px; height: 350px; background: radial-gradient(circle, rgba(138, 43, 226, 0.4) 0%, rgba(255,255,255,0) 70%); border-radius: 50%; filter: blur(20px); }
.img-award-floating { width: 100%; max-width: 400px; position: relative; z-index: 2; transition: transform 0.5s ease; }

/* RESPONSIVE */
@media (max-width: 1024px) {
    .headline-giant { font-size: 6rem; }
    .page-intro { min-height: auto; height: auto; padding: 150px 0 100px; }
    .overview-grid, .mission-grid, .map-layout, .timeline-layout, .leadership-grid, .award-grid-light, .panama-projects-grid { 
        grid-template-columns: 1fr; gap: 40px; 
    }
    .mission-image-col, .map-visual-col, .timeline-header-col { order: -1; }
    .timeline-sticky-content { position: relative; top: 0; text-align: left; }
    .headline-lg.text-right { text-align: left; }
    .body-sm.text-right { text-align: left; }
    .stack-card { height: auto; min-height: 80vh; padding: 100px 0; align-items: center; }
    .stack-content { padding-left: 0; text-align: center; }
    .year-giant { font-size: 6rem; }
    .bio-inner-text { padding: 0 30px 30px; }
    .grow-media-wrapper { width: 90vw; height: 50vh; }
    .map-visual-col { height: 400px; }
    .map-reset-btn { bottom: 15px; right: 15px; }
}

@media (max-width: 768px) {
    .headline-giant { font-size: 3.5rem; letter-spacing: -1px; }
    .headline-lg { font-size: 2.5rem; }
    .headline-mission { font-size: 2.2rem; }
    .headline-light-huge { font-size: 3rem; }
    .section-pad { padding: 80px 0; }
    .overview-text-col { padding: 20px 0; }
    .map-layout { grid-template-columns: 1fr; }
    .map-data-col { order: 2; }
    .map-visual-col { order: 1; }
    .t-content-wrapper { padding-left: 0; flex-direction: column; }
    .t-image-box { width: 100%; height: 200px; }
    .panama-projects-grid { grid-template-columns: 1fr; }
    .project-card { padding: 30px 20px; }
    .btn-group-center { flex-direction: column; }
    .gallery-item { width: 80vw; height: 250px; }
}