:root {
    /* Alto del navbar; lo recalcula JS en tiempo real (ver servicios.php) */
    --lg-nav-h: 74px;
}

/* ------------------------------------------------------------
   HERO
   ------------------------------------------------------------ */

.lg-svcp-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--lg-teal) 0%, var(--lg-teal-dark) 55%, #07434A 100%);
    color: #fff;
    padding: clamp(3rem, 7vw, 5rem) 0 clamp(3rem, 6vw, 4.25rem);
}

.lg-svcp-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .14) 1.5px, transparent 1.5px);
    background-size: 18px 18px;
    mask-image: radial-gradient(ellipse at 50% 0%, black, transparent 78%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 0%, black, transparent 78%);
    pointer-events: none;
}

.lg-svcp-hero .lg-eyebrow {
    color: rgba(255, 255, 255, .85);
}

.lg-svcp-hero .lg-eyebrow::before {
    background: #fff;
    opacity: .6;
}

.lg-svcp-hero-inner {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 760px;
    margin: 0 auto;
}

.lg-svcp-hero h1 {
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.08;
    font-size: clamp(2rem, 5vw, 3.25rem);
    margin-bottom: .85rem;
    text-wrap: balance;
}

.lg-svcp-hero p {
    color: rgba(255, 255, 255, .85);
    font-size: clamp(.95rem, 1.6vw, 1.1rem);
    max-width: 56ch;
    margin: 0 auto;
    line-height: 1.6;
}

/* Rutas decorativas */
.lg-svcp-routes {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: .25;
}

.lg-svcp-routes path {
    fill: none;
    stroke: #fff;
    stroke-width: 1.5;
    stroke-dasharray: 6 10;
    animation: lgDash 24s linear infinite;
}

.lg-svcp-routes path:nth-child(2) {
    animation-duration: 32s;
    animation-direction: reverse;
}

/* ------------------------------------------------------------
   ÍNDICE DE SERVICIOS (sticky)
   ------------------------------------------------------------ */

.lg-svcp-nav {
    position: sticky;
    top: var(--lg-nav-h);
    z-index: 1020;
    background: color-mix(in srgb, var(--lg-surface) 92%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--lg-mist);
}

.lg-svcp-nav-inner {
    display: flex;
    align-items: center;
    gap: .4rem;
    overflow-x: auto;
    padding: .7rem 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.lg-svcp-nav-inner::-webkit-scrollbar {
    display: none;
}

.lg-svcp-nav a {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .45rem .85rem;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    color: var(--lg-ink-soft);
    border: 1px solid transparent;
    flex-shrink: 0;
    transition: color .2s var(--lg-ease-out), background-color .2s var(--lg-ease-out), border-color .2s var(--lg-ease-out);
}

.lg-svcp-nav a:hover {
    color: var(--lg-ink);
    background: var(--lg-mist);
}

.lg-svcp-nav a.is-active {
    color: var(--lg-teal);
    background: var(--lg-teal-light);
    border-color: color-mix(in srgb, var(--lg-teal) 30%, transparent);
}

.lg-svcp-nav-num {
    font-family: var(--lg-font-mono);
    font-size: .68rem;
    opacity: .7;
}

/* Sombra de desbordamiento a los lados en móvil */
.lg-svcp-nav-wrap {
    position: relative;
}

.lg-svcp-nav-wrap::after {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(90deg, transparent, var(--lg-surface));
    pointer-events: none;
}

@media (min-width: 992px) {
    .lg-svcp-nav-wrap::after {
        display: none;
    }
    .lg-svcp-nav-inner {
        justify-content: center;
        flex-wrap: wrap;
        overflow-x: visible;
    }
}

/* ------------------------------------------------------------
   FILAS DE SERVICIO (zigzag)
   ------------------------------------------------------------ */

.lg-svcp-list {
    padding: clamp(2.5rem, 6vw, 4.5rem) 0;
}

.lg-svcp-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: center;
    padding: clamp(2rem, 5vw, 3.5rem) 0;
    position: relative;
    scroll-margin-top: calc(var(--lg-nav-h) + 70px);
}

.lg-svcp-row + .lg-svcp-row {
    border-top: 1px solid var(--lg-mist);
}

/* Alterna el lado de la imagen */
.lg-svcp-row:nth-child(even) .lg-svcp-visual {
    order: -1;
}

@media (max-width: 767.98px) {
    .lg-svcp-row {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }
    .lg-svcp-row:nth-child(even) .lg-svcp-visual {
        order: 0;
    }
}

/* --- Lado de texto --- */

.lg-svcp-body {
    position: relative;
}

.lg-svcp-num-big {
    position: absolute;
    top: -2.75rem;
    left: -.5rem;
    font-family: var(--lg-font-mono);
    font-weight: 600;
    font-size: clamp(4rem, 9vw, 6.5rem);
    line-height: 1;
    color: var(--lg-teal);
    opacity: .07;
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

[data-bs-theme="dark"] .lg-svcp-num-big {
    opacity: .12;
}

.lg-svcp-body > * {
    position: relative;
    z-index: 1;
}

.lg-svcp-body h2 {
    font-weight: 800;
    letter-spacing: -.025em;
    font-size: clamp(1.4rem, 3.2vw, 2.1rem);
    color: var(--lg-ink);
    margin-bottom: .75rem;
    line-height: 1.15;
    text-wrap: balance;
}

.lg-svcp-body p {
    color: var(--lg-ink-soft);
    font-size: clamp(.92rem, 1.4vw, 1.02rem);
    line-height: 1.7;
    margin: 0;
    max-width: 52ch;
}

/* --- Lado visual --- */

.lg-svcp-visual {
    position: relative;
}

/* Marco desplazado detrás de la imagen */
.lg-svcp-visual::before {
    content: "";
    position: absolute;
    inset: 16px -16px -16px 16px;
    border: 2px solid var(--lg-teal);
    border-radius: 26px;
    opacity: .45;
    z-index: 0;
    transition: inset .35s var(--lg-ease-out), opacity .35s var(--lg-ease-out);
}

.lg-svcp-row:nth-child(even) .lg-svcp-visual::before {
    inset: 16px 16px -16px -16px;
}

.lg-svcp-row:hover .lg-svcp-visual::before {
    inset: 10px -20px -20px 20px;
    opacity: .75;
}

.lg-svcp-row:nth-child(even):hover .lg-svcp-visual::before {
    inset: 10px 20px -20px -20px;
}

.lg-svcp-visual img {
    position: relative;
    z-index: 1;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 22px;
    display: block;
    border: 1px solid var(--lg-mist);
    box-shadow: 0 22px 46px -24px rgba(0, 0, 0, .5);
    transition: transform .4s var(--lg-ease-out);
}

.lg-svcp-row:hover .lg-svcp-visual img {
    transform: translateY(-4px);
}

/* Punto magenta de acento */
.lg-svcp-visual::after {
    content: "";
    position: absolute;
    top: -8px;
    right: -8px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--lg-magenta);
    z-index: 2;
    opacity: 0;
    transform: scale(.5);
    transition: opacity .3s var(--lg-ease-out), transform .3s var(--lg-ease-out);
}

.lg-svcp-row:nth-child(even) .lg-svcp-visual::after {
    right: auto;
    left: -8px;
}

.lg-svcp-row:hover .lg-svcp-visual::after {
    opacity: 1;
    transform: scale(1);
}

/* ------------------------------------------------------------
   CTA DE CIERRE
   ------------------------------------------------------------ */

.lg-svcp-cta {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--lg-teal) 0%, var(--lg-teal-dark) 55%, #07434A 100%);
    color: #fff;
    padding: clamp(3rem, 6vw, 4.5rem) 0;
}

.lg-svcp-cta::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .14) 1.5px, transparent 1.5px);
    background-size: 18px 18px;
    mask-image: radial-gradient(ellipse at 50% 50%, black, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 50%, black, transparent 75%);
    pointer-events: none;
}

.lg-svcp-cta-head {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 52ch;
    margin: 0 auto clamp(1.75rem, 3vw, 2.5rem);
}

.lg-svcp-cta-head .lg-eyebrow {
    color: rgba(255, 255, 255, .85);
}

.lg-svcp-cta-head .lg-eyebrow::before {
    background: #fff;
    opacity: .6;
}

.lg-svcp-cta-head h2 {
    font-weight: 800;
    letter-spacing: -.025em;
    font-size: clamp(1.5rem, 3.4vw, 2.2rem);
    text-wrap: balance;
    margin: 0;
}

.lg-svcp-cta-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    max-width: 860px;
    margin: 0 auto;
}

@media (max-width: 767.98px) {
    .lg-svcp-cta-grid {
        grid-template-columns: 1fr;
    }
}

.lg-svcp-cta-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: var(--lg-surface);
    border: 1px solid var(--lg-mist);
    border-radius: 18px;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 44px -22px rgba(0, 0, 0, .55);
    transition: transform .22s var(--lg-ease-out), border-color .22s var(--lg-ease-out);
}

.lg-svcp-cta-card::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--lg-magenta);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform .28s var(--lg-ease-out);
}

.lg-svcp-cta-card:hover {
    transform: translateY(-4px);
    border-color: var(--lg-teal);
}

.lg-svcp-cta-card:hover::after {
    transform: scaleY(1);
}

.lg-svcp-cta-icon {
    width: 56px;
    height: 56px;
    border-radius: 15px;
    background: var(--lg-teal-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lg-svcp-cta-card h5 {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--lg-ink);
    margin-bottom: .3rem;
}

.lg-svcp-cta-card p {
    color: var(--lg-ink-soft);
    font-size: .88rem;
    margin: 0;
    line-height: 1.55;
}

.lg-svcp-cta-arrow {
    margin-left: auto;
    align-self: center;
    color: var(--lg-ink-soft);
    transition: transform .22s var(--lg-ease-out), color .22s var(--lg-ease-out);
}

.lg-svcp-cta-card:hover .lg-svcp-cta-arrow {
    transform: translateX(4px);
    color: var(--lg-teal);
}

/* ------------------------------------------------------------
   Accesibilidad
   ------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {

    .lg-svcp-routes path {
        animation: none;
    }

    .lg-svcp-row:hover .lg-svcp-visual img,
    .lg-svcp-cta-card:hover,
    .lg-svcp-cta-card:hover .lg-svcp-cta-arrow {
        transform: none;
    }

    .lg-svcp-visual::before,
    .lg-svcp-row:hover .lg-svcp-visual::before {
        transition: none;
    }
}

@media (hover: none) {

    .lg-svcp-row:hover .lg-svcp-visual img,
    .lg-svcp-cta-card:hover {
        transform: none;
    }

    /* En táctil el punto de acento se muestra fijo */
    .lg-svcp-visual::after {
        opacity: 1;
        transform: scale(1);
    }
}


@media print {

    .lg-nav,
    .lg-footer,
    .lg-svcp-nav,
    .lg-svcp-routes,
    .lg-svcp-cta-arrow {
        display: none !important;
    }

    .lg-svcp-hero,
    .lg-svcp-cta {
        background: none !important;
        color: #000 !important;
        padding: 1.5rem 0 !important;
    }

    .lg-svcp-hero::before,
    .lg-svcp-cta::before {
        display: none !important;
    }

    .lg-svcp-hero h1,
    .lg-svcp-hero p,
    .lg-svcp-cta-head h2,
    .lg-svcp-cta-head .lg-eyebrow {
        color: #000 !important;
    }

    .lg-svcp-row {
        break-inside: avoid;
        page-break-inside: avoid;
        border-top: none;
        padding: 1.25rem 0;
    }

    .lg-svcp-row + .lg-svcp-row {
        break-before: page;
        page-break-before: always;
    }

    .lg-svcp-visual::before,
    .lg-svcp-visual::after {
        display: none !important;
    }

    .lg-svcp-visual img {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .lg-svcp-num-big {
        opacity: .12 !important;
        color: #13838E !important;
    }

    .lg-svcp-cta-card {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }
}
