/* Páginas de detalle de servicio (servicios/*.html) */

body.service-detail-page {
    background: var(--bg-alt-light);
}

.service-detail-page .header {
    background: color-mix(in srgb, var(--bg-hero) 88%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Migas de pan — dentro del hero, discretas */
.service-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    font-family: var(--font-body);
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
}

.service-hero .service-breadcrumb a {
    color: color-mix(in srgb, var(--text-light) 52%, transparent);
    text-decoration: none;
    transition: color 0.2s ease;
}

.service-hero .service-breadcrumb a:hover {
    color: var(--accent-soft);
}

.service-hero .service-breadcrumb [aria-current="page"] {
    color: color-mix(in srgb, var(--text-light) 88%, transparent);
    font-weight: 600;
}

.service-breadcrumb-sep {
    margin: 0 0.35rem;
    color: color-mix(in srgb, var(--text-light) 32%, transparent);
    font-size: 0.625rem;
    user-select: none;
}

/* Hero */
.service-hero {
    position: relative;
    min-height: clamp(20rem, 48vh, 30rem);
    display: flex;
    align-items: flex-end;
    padding: calc(5.5rem + env(safe-area-inset-top, 0px)) 0 3.5rem;
    background-color: var(--bg-hero);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.service-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        rgba(3, 11, 24, 0.92) 0%,
        rgba(3, 11, 24, 0.72) 42%,
        rgba(3, 11, 24, 0.45) 100%
    );
    pointer-events: none;
}

.service-hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 5rem;
    background: linear-gradient(to top, var(--bg-alt-light), transparent);
    pointer-events: none;
}

.service-hero .container {
    position: relative;
    z-index: 1;
    width: 100%;
}

.service-hero-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--primary);
    margin-bottom: 0.5rem;
    display: block;
}

.service-hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.75rem, 8vw, 4.5rem);
    line-height: 0.95;
    color: var(--text-light);
    letter-spacing: 0.02em;
    max-width: 16ch;
    margin-bottom: 0.75rem;
}

.service-hero-lead {
    font-family: var(--font-body);
    font-size: clamp(1rem, 2.2vw, 1.2rem);
    color: color-mix(in srgb, var(--text-light) 82%, transparent);
    max-width: 42rem;
    line-height: 1.6;
}

.service-hero--rehabilitacion {
    background-image: url('img/services/hero-servicio-rehabilitacion.webp');
}

.service-hero--equipamiento {
    background-image: url('img/services/hero-servicio-equipamiento.webp');
}

.service-hero--obra-acabados {
    background-image: url('img/services/hero-servicio-obra-acabados.webp');
}

.service-hero--fugas {
    background-image: url('img/services/hero-servicio-fugas.webp');
}

/* Cuerpo: texto + fotos a la izquierda, beneficios flotando a la derecha */
.service-body {
    padding: 2.75rem 0 4rem;
    margin-top: -1rem;
}

.service-body-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: start;
}

@media (min-width: 992px) {
    .service-body-grid {
        grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
        gap: 2rem 1.25rem;
    }
}

.service-body-main {
    min-width: 0;
}

.service-intro {
    padding: 0 0 2rem;
}

.service-intro-text h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1.25rem;
}

.service-intro-text p {
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.service-features {
    list-style: none;
    margin-top: 1.5rem;
    display: grid;
    gap: 0.65rem;
}

.service-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.service-features .check-icon {
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
    color: var(--primary);
    margin-top: 0.15rem;
}

/* Panel beneficios — estilo claro, columna flotante */
.service-benefits-panel {
    background: #ffffff;
    border: 1px solid color-mix(in srgb, var(--text-dark) 9%, transparent);
    border-radius: 1rem;
    padding: 1.85rem 1.65rem;
    box-shadow: 0 12px 48px rgba(15, 28, 46, 0.1);
    position: sticky;
    top: calc(5.5rem + env(safe-area-inset-top, 0px));
    width: 100%;
    align-self: start;
}

@media (min-width: 992px) {
    .service-benefits-panel {
        margin-right: calc(-2rem - max(0px, (100vw - 1200px) / 2));
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
    }
}

@media (max-width: 991px) {
    .service-benefits-panel {
        position: static;
    }

    /* Móvil: descripción → beneficios/CTA → galería (el CTA no queda enterrado al final) */
    .service-body-grid {
        display: flex;
        flex-direction: column;
    }

    .service-body-main {
        display: contents;
    }

    .service-intro {
        order: 1;
    }

    .service-benefits-panel {
        order: 2;
    }

    .service-photos {
        order: 3;
        padding-top: 0.25rem;
    }
}

.service-benefits-panel h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.15rem;
}

.service-benefit-item {
    padding: 0.95rem 0;
    border-bottom: 1px solid color-mix(in srgb, var(--text-dark) 8%, transparent);
}

.service-benefit-item:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.service-benefit-item:first-of-type {
    padding-top: 0;
}

.service-benefit-item strong {
    display: block;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.35rem;
}

.service-benefit-item p {
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text-muted);
    margin: 0;
}

.service-panel-cta {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
}

.service-panel-cta .btn-glow {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.95rem 1.25rem;
    font-size: 0.95rem;
    border-radius: 0.5rem;
}

.service-panel-cta-note {
    margin: 0.75rem 0 0;
    text-align: center;
    font-family: var(--font-body);
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Galería 4 fotos */
.service-photos {
    padding: 0;
    background: transparent;
}

/* Oculto temporalmente — quitar clase/atributos hidden para mostrar */
.service-photos--hidden {
    display: none !important;
}

.service-photos-header {
    margin-bottom: 2rem;
}

.service-photos-header h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--text-dark);
}

.service-photos-header p {
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-size: 1rem;
}

.service-photos-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 640px) {
    .service-photos-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.service-photo-slot {
    border-radius: 1rem;
    overflow: hidden;
    aspect-ratio: 4/3;
    background: var(--bg-alt-dark);
    box-shadow: var(--shadow);
}

.service-photo-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
}

.service-photo-slot:hover img {
    transform: scale(1.03);
}

/* Equipamiento: imágenes verticales a tamaño natural, sin marco rígido ni recorte */
.service-photos--contain .service-photos-grid {
    align-items: start;
}

.service-photos--contain .service-photo-slot {
    aspect-ratio: unset;
    height: auto;
    background: transparent;
    box-shadow: none;
    overflow: visible;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.service-photos--contain .service-photo-slot img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: clamp(20rem, 42vw, 26rem);
    object-fit: contain;
    object-position: center top;
    display: block;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    background: #fff;
    transition: none;
}

.service-photos--contain .service-photo-slot:hover img {
    transform: none;
}

/* Desktop: columnas iguales, proporción 3:4 — sin bandas si las fotos son 900×1200 */
@media (min-width: 640px) {
    .service-photos--contain .service-photo-slot {
        width: 100%;
        aspect-ratio: 3 / 4;
        background: transparent;
        box-shadow: var(--shadow);
        border-radius: 1rem;
        overflow: hidden;
        align-items: stretch;
    }

    .service-photos--contain .service-photo-slot img {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        object-fit: cover;
        object-position: center top;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
    }
}
