html {
    scroll-behavior: smooth;
    text-rendering: optimizeLegibility;
}


body {
    /*font-family: Arial, sans-serif;*/
    font-family: 'Raleway', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-color: #DFE4E4;
    color: #1D324D;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 2rem;
    background-color: #1D324D;
    color: #F1EADC;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1);
}

/*header.scrolled {
    background-color: #457373;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.2);
}*/

.logo img {
    width: 180px;
    height: auto;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    font-weight: bold;
}

nav ul li a {
    text-decoration: none;
    color: #F1EADC;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

nav ul li a:hover, nav ul li a:focus {
    background-color: #F1EADC;
    color: #1D324D;
    transform: scale(1.05);
}

.hero {
    text-align: center;
    padding: 2rem;
    background-image: url('img/MolinoSAC.jpg');
    background-size: cover;
    background-position: center;
    color: #F1EADC;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.hero * {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 3.5rem;
    margin: 0 100px 20px;
    line-height: 1.2;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
}

.hero p {
    font-size: 1.8rem;
    padding: 0 120px;
    text-align: justify;
    line-height: 1.6;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
}

.hero .btn {
    font-size: 1.5rem;
    display: inline-block;
    background-color: #7C4935;
    border: 1px solid #5A3226;
    color: #F1EADC;
    width: 300px;
    height: auto;
    text-align: center;
    margin: 20px auto;
    padding: 1rem 0;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.hero .btn:hover {
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.3);
    transform: translateY(-3px);
}

.services {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 2rem;
}

.service {
    flex: 1;
    height: 300px;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.service:hover {
    transform: translateY(-10px);
    box-shadow: 0px 6px 20px rgba(0, 0, 0, 0.2);
}

.service .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    color: #F1EADC;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    text-align: justify;
    overflow-y: auto;
    transition: background-color 0.3s ease;
}

.service:hover .overlay {
    background-color: rgba(0, 0, 0, 0.7);
}

.service h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.7);
    padding-right: 30px;
}

.service p {
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
    padding: 0 30px 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 6em; /* Limita el texto a 4 líneas */
} 

footer {
    text-align: center;
    padding: 1rem;
    background-color: #1D324D;
    color: #F1EADC;
    font-size: 1rem;
    font-weight: bold;
}

h2 {
    color: #7C4935;
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 2.2rem;
}

.carousel-container {
    position: relative;
    width: 80%;
    margin: 0 auto;
    overflow: hidden;
}

.carousel {
    display: flex;
    gap: 10px;
    transition: transform 0.3s ease-in-out;
    will-change: transform;
}

.carousel-item {
    min-width: 200px;
    min-height: 200px;
    flex: 0 0 auto;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

.carousel-item img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease-in-out;
}


.carousel-item img:hover {
    transform: scale(1.05);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    z-index: 10;
    border-radius: 50%;
    font-size: 1.5rem;
    transition: background-color 0.3s ease;
}

.carousel-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

/* Formulario de contacto */
.form-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 2rem;
}

.contact-form {
    background-color: #F1EADC;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-form label {
    font-size: 1.1rem;
    font-weight: bold;
    color: #1D324D;
}

.contact-form input,
.contact-form textarea {
    width: 94%;
    padding: 0.8rem;
    border: 1px solid #1D324D;
    border-radius: 8px;
    font-size: 1rem;
    color: #1D324D;
    background-color: #fff;
    transition: box-shadow 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    box-shadow: 0px 0px 8px rgba(29, 50, 77, 0.5);
    outline: none;
}

.contact-form .btn-submit {
    background-color: #7C4935;
    border: 1px solid #5A3226;
    color: #F1EADC;
    padding: 0.8rem;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.contact-form .btn-submit:hover {
    background-color: #5A3226;
    transform: scale(1.05);
}

nav ul li a.active {
    background-color: #5A3226;
    color: #F1EADC;
}

/* Estilos Responsivos */

@media screen and (max-width: 768px) {
    header {
        flex-direction: column;
        padding: 10px;
    }
    
    nav ul {
        flex-direction: column;
        display: none;
        text-align: center;
    }
    
    nav ul.active {
        display: flex;
    }
    
    .hero {
        height: auto;
        padding: 3rem 1rem;
    }
    
    .hero h1 {
        font-size: 2rem;
        margin: 0;
    }
    
    .hero p {
        font-size: 1rem;
        padding: 0;
    }
    
    .services {
        flex-direction: column;
        gap: 2rem;
        padding: 1rem;
    }
    
    .service {
        height: auto;
        padding: 1.5rem;
        min-height: 150px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        text-align: center;
    }
    
    .service h3 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .service p {
        font-size: 1rem;
        line-height: 1.4;
        max-height: none;
    }
    
    .contact-form {
        width: 100%;
        padding: 1rem;
    }
    
    .carousel-container {
        width: 100%;
        overflow: hidden;
        position: relative;
    }
    
    .carousel {
        display: flex;
        gap: 10px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    
    .carousel-item {
        flex: 0 0 auto;
        width: 80%;
        max-width: 250px;
        height: auto;
        scroll-snap-align: center;
        display: block;
    }
    
    .carousel-item img {
        width: 100%;
        height: auto;
        object-fit: cover;
        display: block;
    }
    
    footer {
        padding: 1rem;
        text-align: center;
        font-weight: bold;
    }
}