/* --- Header & Navigation --- */
.main-header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    height: 120px; /* Altura inicial explícita */
    background-color: #fff;
    border-bottom: 1px solid #eee;
    transition: padding 0.5s ease-in-out, height 0.5s ease-in-out;
    box-sizing: border-box; /* Asegura que el padding se incluya en la altura */
}

.main-header.scrolled {
    padding: 0px 0;
    height: 60px;
    z-index: 1000;
    opacity: 0.9;
}

.main-header__container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    perspective: 1000px; /* Add perspective for 3D effect */
}

.logo-flipper {
    width: 300px; /* Adjust width as needed */
    height: 120px; /* Initial height */
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s 0.0s, height 0.5s 0.0s ease-in-out; /* transform [duration] [delay] */
}

.logo-flipper__face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    object-fit: contain; /* Ensures logos scale correctly */
}

.logo-flipper__face--front {
    transform: rotatex(0deg);
}

.logo-flipper__face--back {
    transform: rotatex(180deg);
}

.main-header.scrolled .logo-flipper {
    transform: rotatex(180deg);
    height: 60px; /* Adjust height when scrolled */
}

/* Desktop Nav */
.main-nav {
    height: 100%;
}
.main-nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    height: 100%;
    margin: 0;
    padding: 0;
}

.main-nav ul li {
    display: flex; /* Use flex to center content */
    align-items: center;
    margin: 0;
    height: 100%;
}

.main-nav ul li a {
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 100%;
    color: #333;
    font-weight: 500;
    text-decoration: none;
}

.main-nav ul li a:hover,
.main-nav ul li a.btn-contact:hover {
    background-color: #0a3148; /* Blue background on hover */
    color: #fff;
    animation: none; /* Prevent animation on hover */
}

.main-nav ul li.active a {
    background-color: #0a3148; /* Blue background */
    color: #fff;
}

/* Special style for the Contact button */
.main-nav ul li a.btn-contact {
    background-color: #ef7f16;
    color: #fff;
    border-radius: 30px; /* More rounded */
    padding: 10px 30px; /* Make it wider */
    height: auto; /* Override the 100% height */
    margin-left: 15px; /* Add some space to its left */
}

/* Animation for mouse-out */
@keyframes fadeOutOrange {
    0% {
        background-color: #0a3148; /* from blue */
        color: #fff;
    }
    50% {
        background-color: #ef7f16; /* to orange */
        color: #fff;
    }
    100% {
        background-color: transparent; /* to transparent */
        color: #333;
    }
}

/* Animation for contact button mouse-out */
@keyframes fadeOutOrangeContact {
    0% {
        background-color: #0a3148; /* from blue */
    }
    50% {
        background-color: #ef7f16; /* to orange */
    }
    100% {
        background-color: #ef7f16; /* stay orange */
    }
}

.fade-out {
    animation: fadeOutOrange 0.6s forwards;
}

.fade-out-contact {
    animation: fadeOutOrangeContact 0.6s forwards;
}

/* Hamburger Button (Hidden on Desktop) */
.hamburger-btn {
    display: none;
}