/* ============================================================================
   PÁGINA: Servicios
   ============================================================================ */
.container-servicios {
    width: 100%;
}

/* ============ BANDA HERO (mismo formato que acerca_de_nosotros) ============ */
.services-hero {
    position: relative;
    width: 100%;
    min-height: 380px;
    aspect-ratio: 16 / 7;
    max-height: 600px;
    background-image: url('../../imagen/servicios.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
}

/* Capa oscura para que el texto se lea sobre la imagen */
.services-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(8, 25, 50, 0.85) 0%,
        rgba(8, 25, 50, 0.55) 50%,
        rgba(8, 25, 50, 0.15) 100%
    );
    z-index: 1;
}

.services-hero__content {
    position: relative;
    z-index: 2;
    max-width: 560px;
    padding: clamp(1.5rem, 4vw, 3rem);
    color: var(--color-white);
    margin-left: clamp(1rem, 6vw, 4rem);
}

.services-hero__content .eyebrow {
    color: var(--color-white);
    margin-bottom: 1rem;
}
.services-hero__content .eyebrow::before {
    background: var(--color-white);
}

.services-hero__content h1 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    line-height: 1.2;
    letter-spacing: -0.5px;
    margin: 0 0 1rem;
    overflow: hidden;
}

.services-hero__content h1 .slide-left,
.services-hero__content h1 .slide-right {
    display: block;
    opacity: 0;
    animation-duration: 1s;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
    animation-fill-mode: forwards;
}
.services-hero__content h1 .slide-left {
    transform: translateX(-110%);
    animation-name: services-slide-left;
    animation-delay: 0.15s;
}
.services-hero__content h1 .slide-right {
    transform: translateX(110%);
    animation-name: services-slide-right;
    animation-delay: 0.55s;
}

@keyframes services-slide-left {
    0%   { transform: translateX(-110%); opacity: 0; }
    100% { transform: translateX(0);     opacity: 1; }
}
@keyframes services-slide-right {
    0%   { transform: translateX(110%); opacity: 0; }
    100% { transform: translateX(0);    opacity: 1; }
}

.services-hero__lead {
    font-size: clamp(0.95rem, 1.4vw, 1.1rem);
    line-height: 1.6;
    opacity: 0;
    animation: services-fade-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: 1.6s;
}

@keyframes services-fade-up {
    0%   { opacity: 0; transform: translateY(14px); }
    100% { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .services-hero__content h1 .slide-left,
    .services-hero__content h1 .slide-right,
    .services-hero__lead {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }
}

@media (max-width: 800px) {
    .services-hero {
        aspect-ratio: auto;
        min-height: 320px;
    }
    .services-hero__overlay {
        background: linear-gradient(
            180deg,
            rgba(8, 25, 50, 0.65) 0%,
            rgba(8, 25, 50, 0.85) 100%
        );
    }
    .services-hero__content {
        margin-left: 0;
        text-align: center;
    }
    .services-hero__content .eyebrow {
        justify-content: center;
    }
}

/* ============ SECCIÓN DE TARJETAS ============ */
.services-section {
    padding: clamp(3rem, 5vw, 5rem) 0;
}
.services-section .container {
    max-width: 1400px;
    padding-left: 2rem;
    padding-right: 2rem;
}

.services-section .section-head {
    margin-bottom: 3rem;
}

/* Grid: 4 columnas en desktop, ajusta en pantallas más chicas */
.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.75rem;
}

@media (max-width: 1100px) {
    .services-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 820px) {
    .services-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
    .services-grid { grid-template-columns: 1fr; }
}

/* ============ TARJETA DE SERVICIO ============ */
.service-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.service-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(15, 42, 68, 0.10);
    border-color: var(--color-primary);
}

.service-card__img {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--color-bg-soft);
}
.service-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .5s ease;
}
.service-card:hover .service-card__img img {
    transform: scale(1.06);
}

.service-card__body {
    padding: 1.4rem 1.4rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;       /* empuja el botón al fondo aunque varíe el texto */
    gap: 0.85rem;
}

.service-card h3 {
    color: #f0742b;             /* naranja característico de tu referencia */
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0.3px;
    margin: 0;
    text-transform: uppercase;
}

.service-card__excerpt {
    color: var(--color-text-soft);
    font-size: 0.88rem;
    line-height: 1.6;
    margin: 0;
    flex: 1;

    /* Cortar a 8 líneas con elipsis */
    display: -webkit-box;
    -webkit-line-clamp: 8;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-leer-mas {
    align-self: flex-start;
    background: var(--color-bg-soft);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 0.55rem 1.1rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: background .2s ease, color .2s ease, border-color .2s ease, gap .2s ease;
}
.btn-leer-mas i {
    font-size: 0.75rem;
    transition: transform .25s ease;
}
.btn-leer-mas:hover {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
    gap: 0.7rem;
}
.btn-leer-mas:hover i {
    transform: translateX(2px);
}

/* ============ MODAL (estructura lista; visibilidad la maneja JS) ============ */
.service-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.service-modal.is-open {
    display: flex;
    animation: modal-fade .25s ease;
}

.service-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 25, 40, 0.65);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.service-modal__dialog {
    position: relative;
    background: var(--color-white);
    border-radius: 14px;
    width: 100%;
    max-width: 760px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25);
    animation: modal-pop .35s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
}

.service-modal__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--color-bg-soft);
    color: var(--color-text);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background .2s ease, color .2s ease, transform .2s ease;
    z-index: 2;
}
.service-modal__close:hover {
    background: var(--color-primary);
    color: var(--color-white);
    transform: rotate(90deg);
}

.service-modal__content {
    overflow-y: auto;
    padding: 2.5rem 2rem 2rem;
}
.service-modal__content h2 {
    color: var(--color-primary);
    font-size: clamp(1.3rem, 2.5vw, 1.7rem);
    font-weight: 700;
    margin: 0 0 1.2rem;
    letter-spacing: -0.2px;
}
.service-modal__body {
    color: var(--color-text);
    font-size: 0.96rem;
    line-height: 1.7;
}
.service-modal__body p { margin-bottom: 1rem; }
.service-modal__body ul,
.service-modal__body ol { padding-left: 1.4rem; margin-bottom: 1rem; }
.service-modal__body li { margin-bottom: 0.4rem; }
.service-modal__body h3 {
    color: var(--color-primary);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 1.6rem 0 0.7rem;
    padding-left: 0.7rem;
    border-left: 3px solid var(--color-primary);
    line-height: 1.3;
}
.service-modal__body strong { color: var(--color-text); font-weight: 700; }
.service-modal__body em { font-style: italic; color: var(--color-text); }
.service-modal__cta {
    margin-top: 1.5rem;
    padding: 1rem 1.2rem;
    background: var(--color-bg-soft);
    border-left: 4px solid var(--color-primary);
    border-radius: 6px;
    text-align: center;
}

@keyframes modal-fade {
    0%   { opacity: 0; }
    100% { opacity: 1; }
}
@keyframes modal-pop {
    0%   { opacity: 0; transform: scale(0.92) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

@media (max-width: 600px) {
    .service-modal__content { padding: 2.5rem 1.25rem 1.5rem; }
}

/* Bloquear scroll del body cuando el modal está abierto (lo activa JS) */
body.no-scroll { overflow: hidden; }
