/* =========================================
   ESTILOS GENERALES Y NAVBAR (VERSIÓN FINAL LIMPIA)
   ========================================= */

:root {
    --azul-merida: #142b87;
    --rojo-merida: #ff0000;
}

/* 1. CONFIGURACIÓN GLOBAL ANTI-DESBORDE */
html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    /* ESTO MATA EL ESPACIO BLANCO LATERAL */
}

body {
    font-family: 'Roboto', 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: 16px;
    padding-top: 150px;
    /* Espacio para PC */
    margin: 0;
    text-align: left;
    color: #333;
}

/* --- TÍTULOS --- */
h1,
h2 {
    color: #4b5991 !important;
    font-weight: 700;
    text-align: center !important;
    letter-spacing: -0.5px;
    margin-bottom: 30px;
}

h3,
h4,
h5,
h6,
.card-title {
    color: #4b5991 !important;
    font-weight: 600;
    text-align: left !important;
}

h5,
h6 {
    color: #747da1 !important;
}

p {
    color: rgba(0, 0, 0, 0.75);
    line-height: 1.8;
    text-align: left;
}

/* --- SECCIÓN INICIO --- */
#inicio {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center !important;
    padding: 0 15px;
    background-color: #142b8713;
    margin: 20px 0;
}

#texto-bienvenida {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto !important;
}

#bienvenida {
    text-align: center !important;
    margin: 0 auto;
    display: block;
}

/* --- SECCIONES IZQUIERDA --- */
.card-body,
.card-text,
#nosotros,
#nosotros p {
    text-align: left !important;
}


/* 2. NAVBAR (ESCRITORIO) */
.navbar {
    font-family: 'Poppins', sans-serif;
    background-color: var(--azul-merida) !important;
    height: 150px;
    border-bottom: 5px solid var(--rojo-merida);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1030;
    text-align: left;
}

.navbar-brand .logo-img {
    height: 130px;
    width: auto;
    transition: all 0.4s ease;
}

.company-name .line1 {
    font-size: 3rem;
    color: var(--rojo-merida) !important;
    font-weight: 800;
    line-height: 1;
    transition: all 0.4s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.25);
}

.company-name .line2 {
    font-size: 1rem;
    color: white;
    opacity: 1;
    margin-left: 2px;
}

/* Navbar Shrink */
.navbar.shrink {
    height: 80px;
    background-color: rgba(20, 43, 135, 0.98) !important;
    border-bottom: 3px solid var(--rojo-merida);
}

.navbar.shrink .navbar-brand .logo-img {
    height: 60px;
}

.navbar.shrink .company-name .line1 {
    font-size: 1.5rem;
    margin-bottom: 0;
    text-shadow: none;
}

.navbar.shrink .company-name .line2 {
    font-size: 0.7rem;
    opacity: 0.9;
}

.nav-up {
    transform: translateY(-170px);
}

/* Botón Contacto */
.btn-outline-blanco {
    border: 2px solid white;
    color: white !important;
    border-radius: 50px;
    padding: 12px 35px;
    transition: all 0.3s ease;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
}

.btn-outline-blanco:hover {
    background-color: var(--rojo-merida) !important;
    border-color: var(--rojo-merida) !important;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.6);
    transform: scale(1.05);
}

.navbar.shrink .btn-outline-blanco {
    padding: 6px 20px;
    font-size: 0.85rem;
}


/* =========================================
   RESPONSIVE (MÓVIL - SUBTÍTULO VISIBLE)
   ========================================= */
@media (max-width: 991px) {

    /* 1. AJUSTE DEL CUERPO */
    body {
        padding-top: 100px !important;
    }

    /* 2. NAVBAR */
    .navbar,
    .navbar.shrink {
        height: 100px !important;
        padding: 0;
        align-items: center;
        display: flex;
    }

    .navbar .container {
        display: flex;
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding-right: 15px;
        padding-left: 15px;
    }

    /* 3. LOGO Y TEXTO */
    .navbar-brand {
        max-width: 75%;
        display: flex;
        align-items: center;
        overflow: hidden;
        white-space: nowrap;
    }

    .navbar-brand .logo-img,
    .navbar.shrink .navbar-brand .logo-img {
        height: 50px;
        /* Logo un poco más chico para dar espacio al texto */
        width: auto;
    }

    /* AJUSTE DEL TÍTULO "MERIDA" */
    .company-name .line1,
    .navbar.shrink .company-name .line1 {
        font-size: 1.4rem;
        /* Tamaño ajustado */
        margin-bottom: 0;
        line-height: 1.1;
        /* Juntamos un poco las líneas */
    }

    /* ¡AQUÍ ESTÁ EL CAMBIO! HACEMOS VISIBLE EL SUBTÍTULO */
    .company-name .line2 {
        display: block !important;
        /* Forzamos que se vea */
        font-size: 0.65rem;
        /* Letra pequeña para que quepa */
        opacity: 0.9;
        white-space: normal;
        /* Permite que se adapte si es necesario */
    }

    /* 4. MENÚ DESPLEGABLE */
    .navbar-collapse {
        background-color: var(--azul-merida);
        width: 100%;
        margin-top: 0 !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        position: absolute;
        top: 100%;
        left: 0;
        padding: 0 15px 15px 15px;
        z-index: 1000;
    }

    .navbar-nav .nav-item {
        width: 100%;
        text-align: left;
    }

    .navbar-nav .nav-link {
        padding: 12px 5px;
        color: white !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .navbar-toggler {
        border: 1px solid rgba(255, 255, 255, 0.5);
        padding: 5px 10px;
        margin-left: auto;
    }

    .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
    }

    .btn-outline-blanco {
        display: block;
        text-align: center;
        margin-top: 15px;
    }

    .carousel {
        margin-top: 0 !important;
    }
}
/* -------------------------------------------------------
   AQUÍ EMPIEZA EL CARRUSEL... (Pega aquí el resto de tu código)
   ------------------------------------------------------- */
/* CARRUSEL */
#taller_2012 {
    background-color: rgba(0, 0, 0, 0.379);
}
/* Forzamos que el contenedor del texto se centre */
.carousel-caption {
    text-align: center !important;
    left: 15%;
    right: 15%;
}

/* Forzamos que los títulos (h5) y párrafos (p) dentro del carrusel sean blancos y centrados */
.carousel-caption h5,
.carousel-caption p,
.texto_carrusel {
    color: #ffffff !important;
    /* Blanco puro */
    text-align: center !important;
    /* Centrado obligatorio */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    /* Sombra negra para que se lea bien sobre la foto */
}
/* CONTENIDO */
.custom-container {
    width: 80%;
    max-width: 100%;
    margin: 0 auto;
}

@media (max-width: 900px) {
    .custom-container {
        width: 100%;
    }
}

/* SERVICIOS Y OTROS (Tus estilos originales siguen aquí) */
#btn-leermas {
    position: absolute;
    bottom: 10px;
    right: 10px;
    color: grey;
    padding: 10px 20px;
    border-radius: 5px;
    text-align: center;
}

#btn-leermas:hover {
    color: white;
    background-color: grey;
}

.card-text {
    text-align: justify;
    color: rgba(0, 0, 0, 0.71);
}

#card-service {
    max-width: 550px;
}

@media (max-width: 767.98px) {
    #card-service {
        width: 300px;
    }

    #img_servicio {
        border-radius: 5px;
    }

    #btn-leermas {
        position: relative;
    }
}

#mas-servicios {
    margin-top: 50px;
    padding: 2%;
}

/* MAQUINAS */
.cards-wrapper {
    display: flex;
    justify-content: center;
}

#card-maq {
    margin: 0 0.5em;
    box-shadow: 2px 6px 8px 0 rgba(22, 22, 26, 0.18);
    border: none;
    border-radius: 0;
    max-width: 320px;
}

#inner {
    padding: 1em;
}

#atras-control,
#siguiente-control {
    background-color: #142b87;
    width: 5vh;
    height: 5vh;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
}

@media (max-width: 769px) {

    #atras-control,
    #siguiente-control {
        width: 4vh;
        height: 4vh;
    }
}

/* CLIENTES */
#logos_clientes {
    padding: 20px;
}

.logo-cliente {
    max-width: 150px;
    height: auto;
    margin: 10px;
    object-fit: contain;
}

@media (max-width: 768px) {
    .logo-cliente {
        max-width: 100px;
    }
}

/* NOSOTROS */
#nosotros1 {
    padding: 20px 0;
}

#img_nos {
    max-width: 100%;
    max-height: 350px;
    object-fit: contain;
}

@media (max-width: 768px) {
    #img_nos {
        margin: 0 auto;
        display: flex;
        margin-top: 20px;
    }

    .text-md-start {
        text-align: justify;
    }
}

/* MAS NOSOTROS */
#card1 {
    background-color: #142b87;
}

#card2 {
    background-color: rgb(255, 0, 0);
}

#card-nosotros {
    border: 1px solid rgba(128, 128, 128, 0.532);
}

#card-nosotros p {
    color: rgba(0, 0, 0, 0.71);
}

.card-equal-height {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.row {
    display: flex;
    flex-wrap: wrap;
}

#cards {
    display: flex;
    flex-direction: column;
}

.row>#cards .card {
    flex: 1;
}

/* BIOGRAFIA */
#biografia {
    background-color: #142b8713;
}

#img_biografia {
    max-height: 250px;
    max-width: 100%;
    margin: 10px;
}

/* CONTACTO (TU ESTRUCTURA ORIGINAL + COLORES CORPORATIVOS) */
#contacto {
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    max-width: 100%;
}

/* Agregamos color al título para que combine */

@media (max-width: 768px) {
    #contacto {
        padding: 0px;
    }

    #contacto h2 {
        font-size: 1.5rem;
    }
}

form {
    width: 100%;
    max-width: 800px;
    /* Se mantiene tu ancho original */
    margin: 0 auto;
    padding: 50px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 50px;
}

@media (max-width:769px) {
    form {
        max-width: 100%;
        padding: 4%;
        background-color: #ffff;
        box-shadow: none;
        border-top: none;
        /* En móvil lo quitamos si prefieres */
    }
}

.form-group {
    margin-bottom: 20px;
}

input,
textarea {
    width: 100%;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 1.2rem;
    /* Agregamos transición suave para el color */
    transition: border-color 0.3s ease;
}

/* COLOR AL ESCRIBIR (FOCUS) */
input:focus,
textarea:focus {
    outline: none;
    border-color: var(--azul-merida);
    /* Se pone azul al hacer clic */
    box-shadow: 0 0 5px rgba(20, 43, 135, 0.2);
}

textarea {
    resize: vertical;
    height: 200px;
}

#boton-contacto {
    width: 100%;
    padding: 15px;
    background-color: var(--azul-merida);
    /* TU AZUL CORPORATIVO */
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#boton-contacto:hover {
    background-color: var(--rojo-merida);
    /* TU ROJO CORPORATIVO AL PASAR EL MOUSE */
}
/*MAPA*/
#mapa {
    margin-bottom: 10px;
}

@media (max-width: 900px) {
    #mapa {
        margin: 10px;
    }
}

/* FOOTER */
footer {
    background-color: #142b87;
    border-top: 4px solid #d90429;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
    font-size: 0.95rem;
    position: relative;
    z-index: 10;
    text-align: left;
}

.footer-title,
footer h5 {
    color: #ffffff !important;
    font-weight: 700;
    letter-spacing: 1px;
    position: relative;
    display: inline-block;
    opacity: 1 !important;
}

.footer-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background-color: #d90429;
    margin-top: 8px;
}

.contact-item i {
    color: #ff0000 !important;
    font-size: 1.1rem;
    min-width: 25px;
}

.footer-text,
.contact-item span {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 300;
}

footer .table,
footer .table tbody,
footer .table tr,
footer .table td {
    background-color: transparent !important;
    color: rgba(255, 255, 255, 0.9) !important;
    border: none !important;
}

footer .table td {
    padding: 2px 0;
    vertical-align: top;
}

.footer-copyright {
    background-color: rgba(0, 0, 0, 0.2);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
}

.footer-copyright i {
    color: white !important;
}

@media (max-width: 991px) {
    .footer-title::after {
        margin: 8px auto;
    }

    .contact-wrapper {
        display: inline-block;
        text-align: left;
    }

    .footer-section {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    footer {
        text-align: center;
    }
}

/* BOTONES FLOTANTES */
.btn-flotante {
    position: fixed;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    color: white !important;
    font-size: 30px;
}

.btn-flotante:hover {
    transform: scale(1.1);
    box-shadow: 2px 5px 15px rgba(0, 0, 0, 0.4);
}

.whatsapp-btn {
    bottom: 20px;
    background-color: #25d366;
}

.whatsapp-btn:hover {
    background-color: #1da851;
}

.scroll-top {
    bottom: 90px;
    background-color: #142b87;
    display: none;
    opacity: 0;
    font-size: 35px;
}

.scroll-top:hover {
    background-color: #0f1e63;
}

@media (max-width: 768px) {
    .btn-flotante {
        width: 50px;
        height: 50px;
        right: 15px;
        font-size: 24px;
    }

    .whatsapp-btn {
        bottom: 15px;
    }

    .scroll-top {
        bottom: 75px;
    }
}