@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    overflow-x: hidden;
    position: relative;
}

/* ===== LÍNEAS DECORATIVAS DESLIZANTES ===== */
.sliding-decoration {
    position: fixed;
    top: 50%;
    right: -100px;
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #4a90e2, transparent);
    animation: marqueeScroll 4s linear infinite;
    z-index: 1;
    opacity: 0.3;
}

.sliding-decoration:nth-child(2) {
    top: 60%;
    animation-delay: 1s;
    animation-duration: 5s;
}

.sliding-decoration:nth-child(3) {
    top: 70%;
    animation-delay: 2s;
    animation-duration: 3.5s;
}

/* ===== ANIMACIONES KEYFRAMES ===== */
@keyframes slideInFromTop {
    0% {
        transform: translateY(-100px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInFromRight {
    0% {
        transform: translateX(100vw);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideRightToLeft {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

@keyframes marqueeScroll {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

@keyframes wavySlide {
    0% {
        transform: translateX(100%) translateY(0);
        opacity: 0;
    }
    50% {
        transform: translateX(50%) translateY(-10px);
        opacity: 1;
    }
    100% {
        transform: translateX(0) translateY(0);
        opacity: 1;
    }
}

@keyframes fadeInUp {
    0% {
        transform: translateY(50px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeInLeft {
    0% {
        transform: translateX(-100px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeInRight {
    0% {
        transform: translateX(100px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes scaleIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 20px;
    background-color: #fff;
    color: #333;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    /* Animación de entrada deslizante desde la derecha */
    animation: slideInFromRight 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.container:hover {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

/* Efecto de deslizamiento sutil en el contenedor */
.container::before {
    content: '';
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(74, 144, 226, 0.05), transparent);
    animation: slideRightToLeft 8s ease-in-out infinite;
    pointer-events: none;
}

.container:hover {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

/* ===== NAVBAR ===== */
.navbar {
    background: white;
    padding: 15px 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    /* Animación de entrada del navbar */
    animation: slideInFromTop 0.6s ease-out;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo {
    display: flex;
    align-items: center;
    color: #4a90e2;
    font-weight: bold;
    font-size: 18px;
    animation: float 3s ease-in-out infinite;
}

.logo::before {
    content: "🏢";
    margin-right: 10px;
    font-size: 24px;
    animation: pulse 2s ease-in-out infinite;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-menu li {
    animation: fadeInUp 0.6s ease-out;
    animation-delay: calc(0.1s * var(--i, 0));
}

.nav-menu a {
    color: #4a90e2;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    padding: 5px 0;
}

.nav-menu a:hover {
    opacity: 0.7;
    transform: translateY(-3px);
    color: #2c5aa0;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%;
    background: linear-gradient(90deg, #4a90e2, #2c5aa0);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translateX(-50%);
    border-radius: 2px;
}

.nav-menu a:hover::after {
    width: 100%;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

h1 {
    color: #000000;
    text-align: center;
    margin-bottom: 20px;
    padding-top: 40px;
    /* Animación ondulada desde la derecha */
    animation: wavySlide 1s ease-out 0.3s both;
    position: relative;
    overflow: hidden;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #4a90e2, #2c5aa0);
    animation: expandWidth 1s ease-out 1s both;
    transform: translateX(-50%);
    border-radius: 2px;
}

/* Efecto de texto deslizante en el título */
h1::before {
    content: '';
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    animation: slideRightToLeft 2s ease-in-out 1.5s;
    pointer-events: none;
}

@keyframes expandWidth {
    to {
        width: 100px;
    }
}

.img-large {
    width: 100%;
    height: auto;
    margin: 20px 0;
    border-radius: 10px;
    /* Animación de imagen grande */
    animation: scaleIn 0.8s ease-out 0.5s both;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.img-large:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.flex-section {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
    align-items: flex-start;
    /* Animación de la sección flex */
    animation: fadeInUp 0.8s ease-out 0.7s both;
}

.img-small {
    flex: 1 1 250px;
    max-width: 450px;
    border-radius: 10px;
    /* Animación deslizante desde la derecha */
    animation: slideInFromRight 1s ease-out 0.9s both;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.img-small:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

/* Efecto de brillo deslizante en las imágenes */
.img-small::before {
    content: '';
    position: absolute;
    top: 0;
    right: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: all 0.6s ease;
    transform: skewX(-25deg);
    z-index: 1;
}

.img-small:hover::before {
    right: 100%;
}

.text-box {
    flex: 2 1 400px;
    /* Animación del texto */
    animation: fadeInRight 0.8s ease-out 1.1s both;
}

p {
    text-align: justify;
    animation: fadeInUp 0.6s ease-out 1.3s both;
    transition: all 0.3s ease;
}

p:hover {
    color: #2c5aa0;
    transform: translateX(5px);
}

/* ===== ANIMACIONES ADICIONALES PARA INTERACTIVIDAD ===== */
.container > * {
    transition: all 0.3s ease;
}

/* Efectos al hacer scroll (opcional - requiere JavaScript) */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* ===== TEXTO DESLIZANTE CONTINUO ===== */
.sliding-text {
    position: fixed;
    bottom: 20px;
    right: -100%;
    background: rgba(74, 144, 226, 0.1);
    color: #4a90e2;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    animation: marqueeScroll 12s linear infinite;
    z-index: 100;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(74, 144, 226, 0.2);
}

/* ===== PARTÍCULAS DESLIZANTES ===== */
.particle {
    position: fixed;
    width: 4px;
    height: 4px;
    background: #4a90e2;
    border-radius: 50%;
    opacity: 0.6;
    animation: marqueeScroll 6s linear infinite;
    z-index: 1;
}

.particle:nth-child(1) {
    top: 20%;
    animation-delay: 0s;
    animation-duration: 8s;
}

.particle:nth-child(2) {
    top: 40%;
    animation-delay: 2s;
    animation-duration: 6s;
}

.particle:nth-child(3) {
    top: 80%;
    animation-delay: 4s;
    animation-duration: 10s;
}

/* ===== BARRA DE PROGRESO DESLIZANTE ===== */
.progress-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #4a90e2, #2c5aa0);
    animation: slideProgress 4s ease-in-out infinite;
    z-index: 9999;
}

@keyframes slideProgress {
    0%, 100% {
        width: 0%;
        left: 0;
    }
    50% {
        width: 100%;
        left: 0;
    }
    100% {
        width: 0%;
        left: 100%;
    }
}
@media (max-width: 768px) {
    .nav-menu a:hover {
        transform: translateY(-2px);
    }
    
    .img-small:hover {
        transform: translateY(-5px) scale(1.02);
    }
    
    .container:hover {
        transform: translateY(-3px);
    }
}

/* Animación de loading opcional */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(74, 144, 226, 0.2), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* ===== BOTÓN HAMBURGUESA ===== */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
    transition: all 0.3s ease;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: #4a90e2;
    margin: 3px 0;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: center;
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablets */
@media (max-width: 1024px) {
    .container {
        max-width: 95%;
        margin: 30px auto;
        padding: 15px;
    }
    
    .nav-container {
        padding: 0 15px;
    }
    
    .nav-menu {
        gap: 20px;
    }
    
    .flex-section {
        flex-direction: column;
        gap: 15px;
    }
    
    .img-small {
        max-width: 100%;
    }
}

/* Móviles grandes */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: 50px;
        gap: 30px;
        transform: translateX(-100%);
        transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        z-index: 999;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }
    
    .nav-menu.active {
        transform: translateX(0);
    }
    
    .nav-menu li {
        animation: none;
        opacity: 0;
        transform: translateY(30px);
        transition: all 0.3s ease;
    }
    
    .nav-menu.active li {
        opacity: 1;
        transform: translateY(0);
        transition-delay: calc(0.1s * var(--i, 0));
    }
    
    .nav-menu a {
        font-size: 18px;
        padding: 15px 30px;
        border-radius: 25px;
        transition: all 0.3s ease;
    }
    
    .nav-menu a:hover {
        background: rgba(74, 144, 226, 0.1);
        transform: scale(1.05);
    }
    
    .container {
        margin: 20px auto;
        padding: 15px;
        animation: fadeInUp 0.8s ease-out;
    }
    
    h1 {
        font-size: 24px;
        padding-top: 20px;
        margin-bottom: 15px;
    }
    
    .flex-section {
        flex-direction: column;
        gap: 15px;
    }
    
    .text-box {
        order: 2;
    }
    
    .img-small {
        order: 1;
        max-width: 100%;
    }
    
    .img-large {
        margin: 15px 0;
    }
    
    /* Ajustes para animaciones en móvil */
    .nav-menu a:hover {
        transform: scale(1.05);
    }
    
    .img-small:hover {
        transform: translateY(-5px) scale(1.02);
    }
    
    .container:hover {
        transform: translateY(-2px);
    }
    
    /* Elementos decorativos más sutiles */
    .sliding-decoration {
        display: none;
    }
    
    .particle {
        display: none;
    }
    
    .sliding-text {
        display: none;
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    .nav-container {
        padding: 0 10px;
    }
    
    .logo {
        font-size: 16px;
    }
    
    .container {
        margin: 15px auto;
        padding: 12px;
        border-radius: 8px;
    }
    
    h1 {
        font-size: 20px;
        padding-top: 15px;
        margin-bottom: 12px;
    }
    
    .nav-menu {
        top: 60px;
        height: calc(100vh - 60px);
        padding-top: 30px;
        gap: 25px;
    }
    
    .nav-menu a {
        font-size: 16px;
        padding: 12px 25px;
    }
    
    .flex-section {
        gap: 12px;
    }
    
    .img-large,
    .img-small {
        border-radius: 8px;
        margin: 12px 0;
    }
    
    p {
        font-size: 14px;
        line-height: 1.5;
    }
    
    /* Navbar más compacto */
    .navbar {
        padding: 10px 0;
    }
}

/* Móviles muy pequeños */
@media (max-width: 320px) {
    .container {
        margin: 10px auto;
        padding: 10px;
    }
    
    h1 {
        font-size: 18px;
        padding-top: 12px;
        margin-bottom: 10px;
    }
    
    .nav-menu {
        gap: 20px;
        padding-top: 25px;
    }
    
    .nav-menu a {
        font-size: 15px;
        padding: 10px 20px;
    }
    
    p {
        font-size: 13px;
    }
    
    .logo {
        font-size: 14px;
    }
    
    .hamburger span {
        width: 22px;
        height: 2px;
    }
}

/* Ajustes para orientación horizontal en móviles */
@media (max-width: 768px) and (orientation: landscape) {
    .nav-menu {
        height: calc(100vh - 60px);
        padding-top: 20px;
        gap: 20px;
    }
    
    .nav-menu a {
        padding: 10px 25px;
        font-size: 16px;
    }
    
    .container {
        margin: 15px auto;
    }
    
    h1 {
        font-size: 22px;
        padding-top: 15px;
    }
}

/* Mejoras de accesibilidad y UX */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hamburger span {
        transition: none;
    }
    
    .nav-menu {
        transition: none;
    }
}

/* Ajustes para pantallas táctiles */
@media (hover: none) and (pointer: coarse) {
    .nav-menu a:hover {
        background: rgba(74, 144, 226, 0.1);
    }
    
    .img-small:hover,
    .img-large:hover,
    .container:hover,
    p:hover {
        transform: none;
    }
    
    .img-small:active {
        transform: scale(0.98);
    }
}

/* Overlay para cerrar menú móvil */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}


/* ===== CORRECCIÓN DEL ESPACIADO DEL NAVBAR ===== */

/* Ajuste general para el body */
body {
    padding-top: 70px; /* Espacio para el navbar fijo */
}

/* Ajustes específicos para diferentes tamaños de pantalla */

/* Desktop y tablets grandes */
@media (min-width: 769px) {
    body {
        padding-top: 70px;
    }
    
    .container {
        margin-top: 40px;
    }
    
    h1 {
        padding-top: 40px;
    }
}

/* Tablets */
@media (max-width: 1024px) and (min-width: 769px) {
    body {
        padding-top: 70px;
    }
    
    .container {
        margin-top: 30px;
    }
    
    h1 {
        padding-top: 30px;
    }
}

/* Móviles grandes */
@media (max-width: 768px) {
    body {
        padding-top: 75px; /* Más espacio en móviles */
    }
    
    .container {
        margin-top: 20px;
    }
    
    h1 {
        padding-top: 25px; /* Espacio adicional para el título */
        margin-bottom: 20px;
    }
    
    /* Ajuste específico para el navbar en móvil */
    .navbar {
        padding: 12px 0;
        height: 70px; /* Altura fija del navbar */
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    body {
        padding-top: 70px;
    }
    
    .container {
        margin-top: 15px;
    }
    
    h1 {
        padding-top: 20px;
        margin-bottom: 15px;
    }
    
    .navbar {
        padding: 10px 0;
        height: 65px;
    }
}

/* Móviles muy pequeños */
@media (max-width: 320px) {
    body {
        padding-top: 65px;
    }
    
    .container {
        margin-top: 12px;
    }
    
    h1 {
        padding-top: 15px;
        margin-bottom: 12px;
    }
    
    .navbar {
        padding: 8px 0;
        height: 60px;
    }
}

/* Orientación horizontal en móviles */
@media (max-width: 768px) and (orientation: landscape) {
    body {
        padding-top: 65px;
    }
    
    .container {
        margin-top: 15px;
    }
    
    h1 {
        padding-top: 15px;
        margin-bottom: 15px;
    }
    
    .navbar {
        padding: 8px 0;
        height: 60px;
    }
}

/* Asegurar que el menú móvil esté bien posicionado */
@media (max-width: 768px) {
    .nav-menu {
        top: 70px; /* Debe coincidir con la altura del navbar */
    }
    
    .nav-menu.active {
        height: calc(100vh - 70px);
    }
}

@media (max-width: 480px) {
    .nav-menu {
        top: 65px;
    }
    
    .nav-menu.active {
        height: calc(100vh - 65px);
    }
}

@media (max-width: 320px) {
    .nav-menu {
        top: 60px;
    }
    
    .nav-menu.active {
        height: calc(100vh - 60px);
    }
}

/* Corrección adicional para el primer elemento visible */
.container:first-of-type {
    position: relative;
    z-index: 1;
}

/* Si tienes otros elementos que también se superpongan */
main, .main-content, .content {
    position: relative;
    z-index: 1;
}