/* ============================================================
   PÁGINA DE SERVICIOS
   ============================================================ */
.servicios-page {
    padding: 80px 2%; /* espacio alrededor */
    background-color: #ffffff;
}

/* título Principal */
.main-title-servicios {
    font-size: 55px; /* titulo grande para que destaque */
    color: black;
    text-align: center;
    font-weight: 900; /* negrita */
    margin-bottom: 50px;
    text-transform: uppercase;
    position: relative; /* necesario para colocar la línea debajo */
    padding-bottom: 15px;
    display: block;
}

/* línea decorativa */
.main-title-servicios::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 5px; 
    background-color: #0c6135;
    border-radius: 10px;
}

/* --- MENU FILTROS --- */
.servicios-nav {
    display: flex; /* botones en línea */
    justify-content: center;
    align-items: center;
    gap: 0; 
    margin: 0 auto 60px;
    max-width: 900px; /* limitamos el ancho para que no se estiren infinito */
    border-bottom: 1px solid transparent;
    width: 100%;
}

/* botones de filtro */
.filter-btn {
    flex: 1; /* CADA BOTÓN OCUPA EXACTAMENTE EL MISMO ESPACIO (33.3%) */
    padding: 20px 10px;
    border: none;
    background: transparent;
    color: #666;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    position: relative; /* necesario para la línea indicadora */
    transition: all 0.3s ease;
    text-align: center;
    white-space: normal; /* permite que el texto baje de línea si es muy largo en móviles muy pequeños */
    line-height: 1.2;
}

/* línea indicadora inferior */
.filter-btn::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0; /* empieza invisible */
    height: 3px; 
    background-color: #0c6135;
    transition: all 0.3s ease;
}

/* efectos visuales*/
.filter-btn:hover {
    color: #0c6135;
    background-color: rgba(12, 97, 53, 0.03); /* un toque sutil al pasar el ratón */
}

/* botón activo */
.filter-btn.active {
    color: #0c6135;
}

/* línea visiblel en el botón activo */
.filter-btn.active::after {
    width: 100%;
}

/* --- GRID DE SERVICIOS --- */
.service-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* esto hace que el bloque de contenido ocupe todo el espacio disponible */
    width: 100%;
}

.service-body {
    padding: 0 25px;
    width: 100%;
    box-sizing: border-box;
    flex-grow: 1; /* CLAVE: Este elemento se estirará para empujar al footer */
    display: flex;
    flex-direction: column;
}

/* grid de tarjetas */
.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* cuatro columnas iguales */
    gap: 25px; 
    max-width: 1350px; 
    margin: 0 auto; /* centra el grid */
}

/* --- TARJETA DE SERVICIO --- */
.service-card {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start; 
    transition: all 0.3s ease;
    position: relative;
    box-sizing: border-box;
    overflow: hidden; 
    height: 100%;
    box-shadow: none;
    text-align: left; /* texto alineado a la izquierda */
}

/* efecto al pasar el ratón */
.service-card:hover {
    transform: translateY(-10px); /* eleva la tarjeta */
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    border-color: #0c6135;
}

/* --- IMAGEN DEL SERVICIO --- */
.service-image {
    width: 100%;
    height: 150px;
    border-bottom: 1px solid #eee;
}

.service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* ajusta la imagen sin deformar */
}

/* --- CABECERA DE LA TARJETA --- */
.service-header {
    padding: 0 25px; /* Un poco más de aire lateral */
    width: 100%;
    box-sizing: border-box;
}

/* icono del servicio */
.service-icon-circle {
    width: 45px;
    height: 45px;
    background-color: #e8f5ed;
    border-radius: 12px; 
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.service-icon-circle i {
    font-size: 18px;
    color: #0c6135;
}

/* título de la tarjeta */
.service-header h3 {
    font-size: 16px; 
    color: #000;
    font-weight: 800;
    margin-bottom: 15px;
    text-transform: uppercase;
    line-height: 1.2;
}

/* texto del cuerpo de la tarjeta */
.service-body p {
    font-size: 13px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 25px;
    text-align: left;
}

/* boton saber mas */
.services-footer {
    padding: 0 25px 30px 25px; 
    display: flex;
    justify-content: center; 
    width: 100%;
    box-sizing: border-box;
    margin-top: auto; /* CLAVE: Se ancla al fondo de la tarjeta */
}

.btn-saberMas-Servicios {
    background-color: #0c6135;
    color: white;
    padding: 12px 28px;
    border-radius: 12px; 
    text-decoration: none;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    border: transparent 2px solid;
    transition: all 0.3s ease;
    display: inline-block; 
}

.btn-saberMas-Servicios:hover {
    background-color: transparent;
    color: #0c6135;
    border: #0c6135 2px solid;
}

/* ============================================================
   MODAL DE SERVICIOS
   ============================================================ */
.modal {
    display: none;  /* oculto hasta que el js lo active */
    position: fixed;
    z-index: 10000; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px); /* desenfoque del fondo */
    justify-content: center;
    align-items: center;
    padding: 15px; /* margen de seguridad para móvil */
    box-sizing: border-box;
}

/* caja del modal */
.modal-content {
    background: #fff;
    width: 100%;
    max-width: 550px;
    border-radius: 30px;
    padding: 40px;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    animation: modalSlideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-sizing: border-box;
}

/* animacion */
@keyframes modalSlideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* botón cerrar */
.close-modal {
    position: absolute;
    right: 25px;
    top: 20px;
    font-size: 35px;
    cursor: pointer;
    color: #bbb;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #0c6135;
}

/* título del modal */
#modal-titulo-servicio {
    color: #0c6135;
    font-weight: 800;
    margin-bottom: 20px;
    font-size: 24px;
    text-transform: uppercase;
    padding-right: 30px; /* no choca con la X */
    text-align: left;
}

/* area del scroll del modal */
.modal-scroll-area {
    max-height: 60vh; /* para que no se salga de la pantalla en móvil */
    overflow-y: auto;
    margin-bottom: 25px;
    text-align: left;
    color: #555;
    line-height: 1.6;
    font-size: 15px;
}

/* botón de la plataforma */
.btn-plataforma {
    background-color: #0c6135;
    color: #fff;
    display: block;
    text-align: center;
    padding: 18px;
    border-radius: 15px;
    text-decoration: none;
    font-weight: 700;
    text-transform: uppercase;
    transition: background 0.3s;
}

.btn-plataforma:hover {
    background-color: #084a29;
}

/* ============================================================
   RESPONSIVO
   ============================================================ */

@media (max-width: 1100px) {
    .services-grid { 
        grid-template-columns: repeat(2, 1fr); 
        padding: 0 20px;
    }
}

@media (max-width: 768px) {
    .servicios-page {
        padding: 40px 2%;
    }

    .main-title-servicios {
        font-size: 32px;
        margin-bottom: 30px;
    }

    .servicios-nav {
        max-width: 100%;
        margin-bottom: 40px;
        flex-wrap: wrap; /* permite que los botones bajen si es necesario */
    }

    .filter-btn {
        font-size: 11px;
        padding: 15px 5px;
        letter-spacing: 0.5px;
        flex: 1 1 30%; /* ajuste para que se distribuyan mejor */
    }

    .modal-content {
        padding: 30px 20px;
        border-radius: 20px;
    }

    #modal-titulo-servicio {
        font-size: 20px;
    }
}

@media (max-width: 650px) {
    .services-grid { 
        grid-template-columns: 1fr; /* una columna en móvil */
        padding: 0 15px;
    }

    .service-card {
        max-width: 400px;
        margin: 0 auto; /* centra la tarjeta si la pantalla es más ancha */
    }
}

@media (max-width: 480px) {
    .filter-btn {
        font-size: 10px;
        padding: 12px 2px;
    }

    .btn-saberMas-Servicios {
        width: 100%; /* botón grande para fácil click */
        text-align: center;
    }
}