* {
    padding: 0;
    box-sizing: border-box;
    margin: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #ffffff;
    color: #000000;
    scroll-behavior: smooth;
}

body.nav-active::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

body.nav-active::before {
    display: block;
}

#header {
    background-color: rgb(170, 83, 32);
    color: #fff;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease;
}

#header.transparent {
    background-color: rgba(170, 83, 32, 0.8);
}

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

.navbar .logo img {
    height: 50px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav-links .nav-link {
    text-decoration: none;
    color: #fff;
    font-size: 16px;
    transition: color 0.3s ease;
}

.nav-links .nav-link:hover,
.nav-links .nav-link.active {
    color: #f0a500;
    font-weight: bold;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.menu-toggle .bar {
    background-color: #fff;
    height: 3px;
    width: 25px;
    margin: 3px 0;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        background-color: rgb(170, 83, 32);
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        width: 60%;
        padding: 20px;
        padding-top: 60px; /* Ajuste para alinear desde la parte superior, dejando espacio para el header */
        transition: transform 0.3s ease-in-out;
        transform: translateX(-100%);
        z-index: 1000;
        justify-content: flex-start; /* Cambiado de center a flex-start para alinear desde la parte superior */
        align-items: flex-start;
        border-top-right-radius: 20px;
        border-bottom-right-radius: 20px;
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.5);
    }

    .nav-links.active {
        display: flex;
        transform: translateX(0);
    }

    .nav-links li {
        margin: 15px 0;
        width: 100%;
    }

    .nav-links .nav-link {
        font-size: 14px;
        color: #FFFFFF;
        text-decoration: none;
        padding: 10px 10px 10px 20px;
        transition: none;
        text-align: left;
        display: block;
        white-space: nowrap;
    }

    .nav-links .nav-link:hover,
    .nav-links .nav-link.active {
        color: #FFFFFF;
        font-weight: normal;
    }

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

    .menu-toggle.active .bar:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
        height: 4px;
    }

    .menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active .bar:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
        height: 4px;
    }
}

main {
    padding-top: 70px;
}

.featured-image {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.featured-image .banner {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-image .centered-logo {
    position: absolute;
    max-width: 2000px;
    animation: fadeIn 5s ease-in;
}

.slogan-text {
    position: absolute;
    color: rgb(218, 106, 42);
    font-size: 1.8rem;
    font-weight: bold;
    text-transform: uppercase;
    text-align: center;
    top: 70%;
    white-space: nowrap;
    animation: fadeIn 5s ease-in forwards;
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.section-spacing {
    margin: 60px 0;
}

.section-title, .principles-section h1, .services-section h1, .contacto-section h2, .redes-sociales-section h3 {
    font-size: 2.5rem;
    color: #000000;
    text-align: center;
    position: relative;
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.section-title::after, .principles-section h1::after, .services-section h1::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -10px;
    width: 60px;
    height: 4px;
    background-color: rgb(170, 83, 32);
    transform: translateX(-50%);
    animation: underlineGrow 1.5s infinite alternate;
}

@keyframes underlineGrow {
    0% { width: 60px; }
    100% { width: 120px; }
}

.mision-vision-section {
    text-align: center;
    padding: 50px 20px;
    background-color: #ffffff;
}

.wrapper {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.card {
    width: 300px;
    height: 220px;
    transform-style: preserve-3d;
    transition: transform 0.6s ease-in-out;
    cursor: pointer;
    border: 1px solid #fff;
    box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.2), -5px -5px 10px rgba(0, 0, 0, 0.05);
    border-radius: 15px;
    position: relative;
}

.card.flipped {
    transform: rotateY(180deg);
}

.front-page, .back-page {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.front-page {
    background-image: url('mision.jpg');
    background-size: cover;
    background-position: center;
    color: rgb(239, 148, 0);
    font-weight: bold;
}

.card-info {
    font-size: 1.5rem;
    font-weight: bold;
}

.back-page {
    background-color: rgb(224, 140, 38);
    color: rgb(255, 255, 255);
    transform: rotateY(180deg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.card-content {
    text-align: center;
}

.card-description {
    font-size: 1rem;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .wrapper {
        flex-direction: column;
        align-items: center;
    }

    .card {
        width: 80%;
    }
}

.container {
    width: 90%;
    max-width: 1200px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin: 0 auto;
}

.container li {
    position: relative;
    overflow: hidden;
    flex: 1 1 calc(50% - 20px);
    max-width: 250px;
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid #ddd;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease;
}

.container li img {
    width: 100%;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.container li .content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    color: #fff;
    padding: 15px;
    background: linear-gradient(0deg, rgb(0 0 0 / 70%) 10%, rgb(255 255 255 / 0%) 100%);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.container li:hover {
    transform: scale(1.05);
}

.container li:hover .content {
    opacity: 1;
    visibility: visible;
}

.container li .content span {
    scale: 0.85;
    opacity: 0;
    transition: scale 0.3s ease, opacity 0.3s ease;
}

.container li:hover .content span {
    scale: 1;
    opacity: 1;
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
        align-items: center;
    }

    .container li {
        flex: 1 1 100%;
        max-width: 300px;
    }
}

.services-section {
    padding: 50px 20px;
    text-align: center;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
}

.carousel-container {
    display: none;
}

.image-container {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    border: 1px solid #ddd;
    background-color: #f9f9f9;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    width: 100%;
    height: 300px;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
    transition: transform 0.3s ease;
}

.image-container .content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    color: #fff;
    padding: 15px;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.7) 10%, rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.image-container .content span {
    scale: 0.85;
    opacity: 0;
    transition: scale 0.3s ease, opacity 0.3s ease;
}

.image-container:hover {
    transform: scale(1.05);
}

.image-container:hover .content {
    opacity: 1;
    visibility: visible;
}

.image-container:hover .content span {
    scale: 1;
    opacity: 1;
}

.service h3 {
    font-size: 1.8rem;
    color: #000000;
    margin-bottom: 15px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .service {
        padding: 20px;
    }

    .image-container {
        height: auto;
    }

    .service h3 {
        font-size: 1.6rem;
        min-height: 48px;
    }
}

@media (min-width: 769px) {
    .services-grid {
        display: none;
    }

    .carousel-container {
        display: block;
        position: relative;
        width: 100%;
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 50px;
    }

    .carousel-wrapper {
        width: 960px;
        margin: 0 auto;
        overflow: hidden;
    }

    .carousel {
        display: flex;
        scroll-snap-type: x mandatory;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .carousel::-webkit-scrollbar {
        display: none;
    }

    .service {
        flex: 0 0 300px;
        margin: 0 10px;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        scroll-snap-align: start;
    }

    .service img {
        width: 100%;
        height: auto;
        border-radius: 15px;
        margin-bottom: 15px;
    }

    .carousel-btn {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        background-color: rgba(170, 83, 32, 0.7);
        color: white;
        border: none;
        font-size: 24px;
        cursor: pointer;
        padding: 10px 15px;
        z-index: 100;
        border-radius: 50%;
        transition: background-color 0.3s ease;
    }

    .carousel-btn:hover {
        background-color: rgba(170, 83, 32, 1);
    }

    .prev-btn {
        left: 10px;
    }

    .next-btn {
        right: 10px;
    }
}

.contacto-section {
    padding: 40px 20px;
    background-color: #ffffff;
    text-align: center;
}

.contacto-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    flex-direction: row;
}

.contacto-form {
    flex: 1;
    padding: 50px;
    background-color: #ffffff;
    border-radius: 0;
    box-shadow: 0 4px 8px rgb(37, 37, 37);
    margin-left: 20px;
    max-width: 40%;
}

.contacto-imagen {
    flex: 2;
    text-align: center;
}

.contacto-imagen img {
    max-width: 90%;
    border-radius: 10px;
    width: 100%;
    height: auto;
}

.form-group {
    margin-bottom: 15px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #0c0c0c;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #000000;
    border-radius: 5px;
    font-size: 1em;
}

button {
    padding: 10px 20px;
    background-color: #000000;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
}

button:hover {
    background-color: #b05720;
}

.redes-sociales-section {
    text-align: center;
    padding: 20px 0;
    background-color: #ffffff;
}

.redes-sociales-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.redes-button {
    padding: 10px;
    background-color: #ffffff26;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.622);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
}

.redes-button img {
    width: 30px;
    height: 30px;
    transition: transform 0.3s ease;
}

.redes-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.redes-button:hover img {
    transform: scale(1.1);
}

.footer {
    text-align: center;
    padding: 20px;
    background-color: #ffffff;
}

.click-notice {
    display: none;
    font-size: 14px;
    color: rgba(128, 128, 128, 0.7);
    text-align: center;
    margin-top: 10px;
}

@media (min-width: 1025px) {
    #mision-vision .click-notice {
        display: block;
        animation: blink 1s ease-in-out infinite;
    }
}

@media (max-width: 1024px) {
    .click-notice {
        display: block;
        animation: blink 1s ease-in-out infinite;
    }
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}

@media (max-width: 668px) {
    .featured-image {
        height: 70vh;
    }

    .featured-image .centered-logo {
        max-width: 90%;
    }

    .contacto-container {
        flex-direction: column;
    }

    .contacto-form {
        max-width: 100%;
        margin-left: 0;
        margin-top: 20px;
    }

    .contacto-imagen {
        max-width: 100%;
    }

    .slogan-text {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .featured-image {
        height: 50vh;
    }

    .featured-image .centered-logo {
        max-width: 95%;
    }

    .section-title, .principles-section h1, .services-section h1, .contacto-section h2 {
        font-size: 1.8rem;
    }

    .service h3 {
        font-size: 1.3rem;
        min-height: 40px;
    }
}