/* ===== RESET Y CONFIGURACIÓN BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', 'Poppins', sans-serif;
    line-height: 1.6;
    color: #111;
    overflow-x: hidden;
}

body.nav-open {
    overflow: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== PANTALLA DE CARGA ===== */
body.loading {
    overflow: hidden;
}

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a1a1a;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

#loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.logo-container {
    margin-bottom: 20px;
}

.logo-svg {
    width: 300px;
    height: 80px;
}

.logo-text {
    font-size: 42px;
    font-weight: 700;
    fill: #1e3a8a;
    opacity: 0;
    animation: drawText 2s ease-in-out forwards;
}

.logo-subtext {
    font-size: 22px;
    font-weight: 400;
    fill: #ffffff;
    opacity: 0;
    animation: drawText 1.5s ease-in-out 0.5s forwards;
}

@keyframes drawText {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.loading-bar {
    width: 200px;
    height: 4px;
    background: #333;
    border-radius: 2px;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #1e3a8a, #3b82f6);
    width: 0%;
    animation: loadingProgress 3s ease-in-out forwards;
}

@keyframes loadingProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* ===== SCROLL PROGRESS BAR ===== */
.scroll-progress-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.2);
    z-index: 9999;
}

.scroll-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff0000, #ff6600);
    width: 0%;
    transition: width 0.1s ease;
}

/* ===== NAVEGACIÓN ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1002;
    transition: all 0.3s ease;
    transform: translateY(-100%);
    animation: slideDown 0.5s ease 3.5s forwards;
}

/* Dynamic navbar states based on scroll position */
.navbar.nav-hero {
    background: rgba(26, 26, 26, 0.95);
}

.navbar.nav-servicios {
    background: rgba(255, 255, 255, 0.95);
}

.navbar.nav-trayectoria {
    background: rgba(30, 58, 138, 0.95);
}

.navbar.nav-proyectos {
    background: rgba(59, 130, 246, 0.95);
}

.navbar.nav-contacto {
    background: rgba(17, 24, 39, 0.95);
}

@keyframes slideDown {
    to {
        transform: translateY(0);
    }
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo-text {
    font-size: 20px;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.nav-logo-word:first-child {
    color: #1e3a8a;
}

.nav-logo-word:last-child {
    color: #3b82f6;
}

/* Dynamic logo colors based on navbar background */
.navbar.nav-servicios .nav-logo-word:first-child {
    color: #1e3a8a;
}

.navbar.nav-servicios .nav-logo-word:last-child {
    color: #3b82f6;
}

.navbar.nav-trayectoria .nav-logo-word:first-child {
    color: #ffffff;
}

.navbar.nav-trayectoria .nav-logo-word:last-child {
    color: #bfdbfe;
}

.navbar.nav-proyectos .nav-logo-word:first-child {
    color: #ffffff;
}

.navbar.nav-proyectos .nav-logo-word:last-child {
    color: #bfdbfe;
}

.navbar.nav-contacto .nav-logo-word:first-child {
    color: #ffffff;
}

.navbar.nav-contacto .nav-logo-word:last-child {
    color: #3b82f6;
}

.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: #ffffff;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

/* Dynamic text colors based on navbar background */
.navbar.nav-servicios .nav-link {
    color: #1e3a8a;
}

.navbar.nav-servicios .nav-link:hover {
    color: #3b82f6;
}

.navbar.nav-trayectoria .nav-link {
    color: #ffffff;
}

.navbar.nav-trayectoria .nav-link:hover {
    color: #bfdbfe;
}

.navbar.nav-proyectos .nav-link {
    color: #ffffff;
}

.navbar.nav-proyectos .nav-link:hover {
    color: #bfdbfe;
}

.navbar.nav-contacto .nav-link {
    color: #ffffff;
}

.navbar.nav-contacto .nav-link:hover {
    color: #3b82f6;
}

.nav-link:hover {
    color: #3b82f6;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #1e3a8a;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link.active {
    color: #3b82f6;
    font-weight: 600;
}

.nav-link.active::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: #ffffff;
    margin: 3px 0;
    transition: 0.3s;
}

/* Dynamic toggle colors */
.navbar.nav-servicios .nav-toggle span {
    background: #1e3a8a;
}

/* ===== HERO SECTION ===== */
.hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #1e40af 100%);
    z-index: -2;
}

.hero-photo-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 2px;
    opacity: 0.6;
    z-index: -1;
}

.photo-item {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    opacity: 0;
    transform: scale(0.8) rotate(5deg);
    animation: photoAppear 0.8s ease forwards, photoFloat 4s ease-in-out infinite;
}

.photo-item:nth-child(1) { animation-delay: 4.2s, 4.2s; }
.photo-item:nth-child(2) { animation-delay: 4.3s, 4.3s; }
.photo-item:nth-child(3) { animation-delay: 4.4s, 4.4s; }
.photo-item:nth-child(4) { animation-delay: 4.5s, 4.5s; }
.photo-item:nth-child(5) { animation-delay: 4.6s, 4.6s; }
.photo-item:nth-child(6) { animation-delay: 4.7s, 4.7s; }
.photo-item:nth-child(7) { animation-delay: 4.8s, 4.8s; }
.photo-item:nth-child(8) { animation-delay: 4.9s, 4.9s; }
.photo-item:nth-child(9) { animation-delay: 5.0s, 5.0s; }
.photo-item:nth-child(10) { animation-delay: 5.1s, 5.1s; }
.photo-item:nth-child(11) { animation-delay: 5.2s, 5.2s; }
.photo-item:nth-child(12) { animation-delay: 5.3s, 5.3s; }
.photo-item:nth-child(13) { animation-delay: 5.4s, 5.4s; }
.photo-item:nth-child(14) { animation-delay: 5.5s, 5.5s; }
.photo-item:nth-child(15) { animation-delay: 5.6s, 5.6s; }
.photo-item:nth-child(16) { animation-delay: 5.7s, 5.7s; }

@keyframes photoAppear {
    0% {
        opacity: 0;
        transform: scale(0.8) rotate(5deg);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1) rotate(-2deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes photoFloat {
    0%, 100% { 
        transform: translateY(0px) scale(1) rotate(0deg); 
        opacity: 0.6;
    }
    25% { 
        transform: translateY(-6px) scale(1.02) rotate(1deg); 
        opacity: 0.8;
    }
    50% { 
        transform: translateY(-3px) scale(1.01) rotate(-1deg); 
        opacity: 0.7;
    }
    75% { 
        transform: translateY(-9px) scale(1.03) rotate(2deg); 
        opacity: 0.9;
    }
}

.photo-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    transition: all 0.3s ease;
    filter: brightness(0.8) contrast(1.2);
}

.photo-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.photo-item:hover .photo-image {
    filter: brightness(1) contrast(1.1);
    transform: scale(1.02);
}

.hero-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: -1;
}

.hero-content {
    text-align: center;
    color: white;
    z-index: 1;
    opacity: 0;
    transform: translateY(30px);
    animation: heroContentFadeIn 1s ease 4s forwards;
}

@keyframes heroContentFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-text-line {
    display: block;
    opacity: 0;
    transform: translateX(-50px);
    animation: slideInText 0.8s ease 4.5s forwards;
}

.hero-text-line:nth-child(2) {
    animation-delay: 4.8s;
}

@keyframes slideInText {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 40px;
    opacity: 0;
    animation: fadeIn 0.8s ease 5.2s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.hero-btn {
    background: linear-gradient(45deg, #1e3a8a, #3b82f6);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    animation: fadeIn 0.8s ease 5.5s forwards;
    position: relative;
    overflow: hidden;
}

.hero-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.hero-btn:hover::before {
    left: 100%;
}

.hero-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(30, 58, 138, 0.4);
}

.btn-arrow {
    transition: transform 0.3s ease;
}

.hero-btn:hover .btn-arrow {
    transform: translateX(5px);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    animation: fadeIn 0.8s ease 6s forwards;
}

.scroll-arrow {
    width: 20px;
    height: 20px;
    border-right: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(45deg);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: rotate(45deg) translateY(0);
    }
    40% {
        transform: rotate(45deg) translateY(-10px);
    }
    60% {
        transform: rotate(45deg) translateY(-5px);
    }
}

/* ===== SECCIONES GENERALES ===== */
section {
    padding: 100px 0;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 60px;
    color: #111;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #1e3a8a, #3b82f6);
    border-radius: 2px;
}

/* ===== SERVICIOS ===== */
.servicios {
    background: #f5f5f5;
}

.servicios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 60px;
}

.servicio-card {
    background: white;
    padding: 40px 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(50px);
}

.servicio-card.animate {
    animation: slideUpFade 0.8s ease forwards;
}

.servicio-card:nth-child(1) { animation-delay: 0.1s; }
.servicio-card:nth-child(2) { animation-delay: 0.2s; }
.servicio-card:nth-child(3) { animation-delay: 0.3s; }
.servicio-card:nth-child(4) { animation-delay: 0.4s; }
.servicio-card:nth-child(5) { animation-delay: 0.5s; }

@keyframes slideUpFade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.servicio-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.servicio-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.servicio-icon svg {
    width: 40px;
    height: 40px;
    stroke-width: 1.5;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.servicio-card:hover .servicio-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.servicio-card:hover .servicio-icon svg {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.servicio-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #111;
}

.servicio-card p {
    color: #666;
    line-height: 1.6;
}

/* ===== TRAYECTORIA ===== */
.trayectoria {
    background: white;
}

.trayectoria-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 60px;
    align-items: center;
}

.trayectoria-image {
    opacity: 0;
    transform: translateX(-50px);
    animation: slideInLeft 1s ease 0.5s forwards;
}

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.image-container {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
}

.image-placeholder svg {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
    opacity: 0.8;
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
    transition: all 0.3s ease;
    filter: brightness(1.05) contrast(1.1);
}

.profile-image:hover {
    transform: scale(1.02);
    filter: brightness(1.1) contrast(1.15);
}

.trayectoria-text {
    opacity: 0;
    transform: translateX(50px);
    animation: slideInRight 1s ease 0.8s forwards;
}

@keyframes slideInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #1e3a8a, #3b82f6);
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
    opacity: 0;
    transform: translateX(30px);
}

.timeline-item.animate {
    animation: slideInTimeline 0.8s ease forwards;
}

.timeline-item:nth-child(1) { animation-delay: 1.2s; }
.timeline-item:nth-child(2) { animation-delay: 1.4s; }
.timeline-item:nth-child(3) { animation-delay: 1.6s; }
.timeline-item:nth-child(4) { animation-delay: 1.8s; }

@keyframes slideInTimeline {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.timeline-marker {
    position: absolute;
    left: -34px;
    top: 5px;
    width: 12px;
    height: 12px;
    background: #1e3a8a;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 3px #1e3a8a;
}

.timeline-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #111;
}

.timeline-content p {
    color: #666;
    line-height: 1.6;
}

/* ===== PROYECTOS ===== */
.proyectos {
    padding: 80px 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.proyectos-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.proyectos-filtros {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.filtro-btn {
    padding: 12px 24px;
    border: 2px solid #3b82f6;
    background: transparent;
    color: #3b82f6;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 14px;
}

.filtro-btn:hover,
.filtro-btn.active {
    background: #3b82f6;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.proyectos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.proyecto-item {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.proyecto-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.proyecto-item.animate {
    animation: fadeInUp 0.6s ease forwards;
}

.proyecto-image {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.proyecto-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.proyecto-item:hover .proyecto-img {
    transform: scale(1.05);
}

.proyecto-info {
    padding: 25px;
    background: white;
}

.proyecto-info h3 {
    color: #1e293b;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.3;
}

.proyecto-info p {
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

/* Responsive adjustments for project images */
@media (max-width: 768px) {
    .proyectos-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
    }
    
    .proyecto-image {
        height: 200px;
    }
    
    .proyecto-info {
        padding: 20px;
    }
    
    .proyecto-info h3 {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .proyectos-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .proyecto-image {
        height: 180px;
    }
    
    .proyecto-info {
        padding: 15px;
    }
    
    .proyecto-info h3 {
        font-size: 16px;
    }
    
    .proyecto-info p {
        font-size: 13px;
    }
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    transform: scale(0.7);
    animation: modalScaleIn 0.3s ease forwards;
}

@keyframes modalScaleIn {
    to {
        transform: scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 30px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    z-index: 1;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #111;
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.modal-image {
    height: 400px;
}

.modal-image .image-placeholder {
    height: 100%;
    border-radius: 0;
}

.modal-info {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.modal-info h3 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #111;
}

.modal-info p {
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

.modal-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.detail-item:last-child {
    border-bottom: none;
}

/* ===== CONTACTO ===== */
.contacto {
    background: white;
}

.contacto-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.contacto-info {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.contacto-item {
    display: flex;
    gap: 20px;
    opacity: 0;
    transform: translateX(-50px);
    padding: 25px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(30, 58, 138, 0.1);
}

.contacto-item.animate {
    animation: slideInLeft 0.8s ease forwards;
}

.contacto-item:nth-child(1) { animation-delay: 0.2s; }
.contacto-item:nth-child(2) { animation-delay: 0.4s; }
.contacto-item:nth-child(3) { animation-delay: 0.6s; }

.contacto-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.contacto-icon svg {
    width: 24px;
    height: 24px;
    stroke: white;
    stroke-width: 2;
    fill: none;
}

.contacto-item:hover {
    transform: translateX(-50px) translateY(-5px);
    box-shadow: 0 8px 25px rgba(30, 58, 138, 0.2);
    border-color: rgba(30, 58, 138, 0.3);
}

.contacto-item:hover .contacto-icon {
    transform: scale(1.1) rotate(5deg);
}

.contacto-details h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #111;
}

.contacto-details p {
    color: #666;
    margin-bottom: 15px;
}

.contacto-btn {
    display: inline-block;
    background: linear-gradient(45deg, #1e3a8a, #3b82f6);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.contacto-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(30, 58, 138, 0.3);
}

.contacto-mapa {
    opacity: 0;
    transform: translateX(50px);
    animation: slideInRight 1s ease 0.8s forwards;
}

.contacto-mapa iframe {
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Contact item layout modifications */
.contacto-item {
    display: flex;
    align-items: center;
    gap: 20px;
    opacity: 0;
    transform: translateX(-50px);
    padding: 25px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(30, 58, 138, 0.1);
}

.contacto-details {
    flex: 1;
    color: #111;
}

.contacto-details p {
    color: #666;
    margin-bottom: 0;
}

.contacto-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 120px;
}

.contacto-btn {
    display: inline-block;
    background: linear-gradient(45deg, #1e3a8a, #3b82f6);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

/* ===== CALL MODAL ===== */
.call-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.call-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.call-modal-content {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.call-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 25px 25px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.call-modal-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1e3a8a;
    margin: 0;
}

.call-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.call-modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.call-modal-body {
    padding: 25px;
}

.call-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.call-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.call-option-phone {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
}

.call-option-phone:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.call-option-whatsapp {
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: #ffffff;
}

.call-option-whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.3);
}

.call-option-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.call-option-icon svg {
    width: 24px;
    height: 24px;
}

.call-option-text h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 5px 0;
}

.call-option-text p {
    font-size: 0.9rem;
    margin: 0;
    opacity: 0.9;
}

/* ===== FOOTER ===== */
.footer {
    background: #111;
    color: white;
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 60px;
    margin-bottom: 40px;
}

.footer-logo span {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e3a8a;
    display: block;
    margin-bottom: 10px;
}

.footer-logo p {
    color: #999;
    font-size: 0.9rem;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.footer-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1e3a8a;
}

.footer-section a {
    display: block;
    color: #999;
    text-decoration: none;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.footer-section a:hover {
    color: #1e3a8a;
    transform: translateX(5px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #333;
    color: #999;
    font-size: 0.9rem;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .hero-photo-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(5, 1fr);
        gap: 1px;
        opacity: 0.4;
    }
    
    .photo-image {
        filter: brightness(0.7) contrast(1.3);
    }
    
    .nav-menu {
        position: fixed;
        left: -75%;
        top: 70px;
        flex-direction: column;
        background-color: rgba(26, 26, 26, 0.98);
        backdrop-filter: blur(10px);
        width: 75%;
        height: calc(100vh - 70px);
        text-align: center;
        transition: 0.3s ease;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.3);
        padding: 10px 0;
        z-index: 1001;
    }

    /* Dynamic sidenav background colors based on navbar state */
    .navbar.nav-hero .nav-menu { background-color: rgba(26, 26, 26, 0.98); }
    .navbar.nav-servicios .nav-menu { background-color: rgba(255, 255, 255, 0.98); }
    .navbar.nav-trayectoria .nav-menu { background-color: rgba(30, 58, 138, 0.98); }
    .navbar.nav-proyectos .nav-menu { background-color: rgba(59, 130, 246, 0.98); }
    .navbar.nav-contacto .nav-menu { background-color: rgba(17, 24, 39, 0.98); }

    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu .nav-link {
        display: block;
        padding: 6px 20px;
        margin: 1px 0;
        font-size: 15px;
        font-weight: 500;
        color: #ffffff;
        text-decoration: none;
        transition: all 0.3s ease;
        border-radius: 8px;
        margin-left: 20px;
        margin-right: 20px;
    }

    /* Dynamic sidenav link colors based on navbar state */
    .navbar.nav-hero .nav-menu .nav-link { color: #ffffff; }
    .navbar.nav-servicios .nav-menu .nav-link { color: #1e3a8a; }
    .navbar.nav-trayectoria .nav-menu .nav-link { color: #ffffff; }
    .navbar.nav-proyectos .nav-menu .nav-link { color: #ffffff; }
    .navbar.nav-contacto .nav-menu .nav-link { color: #ffffff; }
    
    .nav-menu .nav-link:hover {
        background-color: rgba(59, 130, 246, 0.1);
        color: #3b82f6;
        transform: translateX(10px);
    }

    /* Dynamic sidenav hover colors based on navbar state */
    .navbar.nav-hero .nav-menu .nav-link:hover { 
        background-color: rgba(59, 130, 246, 0.1);
        color: #3b82f6;
    }
    .navbar.nav-servicios .nav-menu .nav-link:hover { 
        background-color: rgba(30, 58, 138, 0.1);
        color: #3b82f6;
    }
    .navbar.nav-trayectoria .nav-menu .nav-link:hover { 
        background-color: rgba(255, 255, 255, 0.1);
        color: #bfdbfe;
    }
    .navbar.nav-proyectos .nav-menu .nav-link:hover { 
        background-color: rgba(255, 255, 255, 0.1);
        color: #bfdbfe;
    }
    .navbar.nav-contacto .nav-menu .nav-link:hover { 
        background-color: rgba(59, 130, 246, 0.1);
        color: #3b82f6;
    }
    
    .nav-menu .nav-link.active {
        background-color: rgba(59, 130, 246, 0.2);
        color: #3b82f6;
        font-weight: 600;
        border-radius: 8px;
    }

    /* Dynamic sidenav active colors based on navbar state */
    .navbar.nav-hero .nav-menu .nav-link.active { 
        background-color: rgba(59, 130, 246, 0.2);
        color: #3b82f6;
    }
    .navbar.nav-servicios .nav-menu .nav-link.active { 
        background-color: rgba(30, 58, 138, 0.2);
        color: #3b82f6;
    }
    .navbar.nav-trayectoria .nav-menu .nav-link.active { 
        background-color: rgba(255, 255, 255, 0.2);
        color: #bfdbfe;
    }
    .navbar.nav-proyectos .nav-menu .nav-link.active { 
        background-color: rgba(255, 255, 255, 0.2);
        color: #bfdbfe;
    }
    .navbar.nav-contacto .nav-menu .nav-link.active { 
        background-color: rgba(59, 130, 246, 0.2);
        color: #3b82f6;
    }
    
    /* Completely disable ::after pseudo-element for mobile nav links */
    .nav-menu .nav-link::after {
        display: none !important;
    }
    
    /* Ensure active mobile nav links don't have the linear underline */
    .nav-menu .nav-link.active::after {
        display: none !important;
        width: 0 !important;
    }
    
    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 1000;
    }
    
    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    .trayectoria-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .trayectoria-image {
        order: 2;
    }

    .trayectoria-text {
        order: 1;
    }

    .contacto-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    /* Fix contact items for mobile - remove translateX and adjust padding */
    .contacto-item {
        transform: none;
        padding: 20px;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .contacto-item:hover {
        transform: translateY(-5px);
    }

    .contacto-icon {
        width: 50px;
        height: 50px;
        flex-shrink: 0;
    }

    .contacto-icon svg {
        width: 20px;
        height: 20px;
    }

    .contacto-details h3 {
        font-size: 1.1rem;
    }

    .contacto-details p {
        font-size: 0.9rem;
    }

    .contacto-actions {
        justify-content: center;
        min-width: auto;
    }

    .contacto-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .footer-links {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .galeria-grid {
        grid-template-columns: 1fr;
    }

    .servicios-grid {
        grid-template-columns: 1fr;
    }

    .servicio-icon {
        width: 70px;
        height: 70px;
        margin: 0 auto 15px;
    }

    .servicio-icon svg {
        width: 35px;
        height: 35px;
    }

    .modal-body {
        grid-template-columns: 1fr;
    }

    .modal-image {
        height: 250px;
    }

    .modal-info {
        padding: 25px;
    }
}

@media (max-width: 480px) {
    .hero-photo-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(8, 1fr);
        gap: 1px;
        opacity: 0.3;
    }
    
    .photo-image {
        filter: brightness(0.6) contrast(1.4);
    }
    
    .container {
        padding: 0 15px;
    }

    section {
        padding: 60px 0;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-btn {
        padding: 12px 25px;
        font-size: 1rem;
    }

    .filtros {
        gap: 10px;
    }

    .filtro-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .servicio-icon {
        width: 60px;
        height: 60px;
        margin: 0 auto 12px;
    }

    .servicio-icon svg {
        width: 30px;
        height: 30px;
    }

    /* Additional contact section fixes for smaller screens */
    .contacto-item {
        padding: 15px;
        gap: 15px;
        flex-direction: column;
        text-align: center;
    }

    .contacto-icon {
        width: 45px;
        height: 45px;
    }

    .contacto-icon svg {
        width: 18px;
        height: 18px;
    }

    .contacto-details h3 {
        font-size: 1rem;
        margin-bottom: 6px;
    }

    .contacto-details p {
        font-size: 0.85rem;
        margin-bottom: 12px;
    }

    .contacto-actions {
        justify-content: center;
        min-width: auto;
    }

    .contacto-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* ===== UTILIDADES ===== */
.hidden {
    display: none !important;
}

.visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* ===== ANIMACIONES DE SCROLL ===== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s ease;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s ease;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s ease;
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
} 

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
} 