/* Vista sección Ciudades/Industria: columna = barra óvalos debajo del navbar + cuerpo (label + contenido) */
.section-view {
    display: flex;
    flex-direction: column;
    height: 70vh;
    min-height: 70vh;
    padding-top: 0;
    margin-top: 3rem; /* Espacio entre navbar y selector de opciones */
    margin-bottom: 2.5rem; /* Espacio inferior para separar del footer */
    background: #313131;
    gap: 0;
}

/* Responsive: ajustar margin-top y margin-bottom en móviles */
@media (max-width: 900px) {
    .section-view {
        margin-top: 2.5rem;
        margin-bottom: 2rem;
    }
}

@media (max-width: 560px) {
    .section-view {
        margin-top: 2rem;
        margin-bottom: 1.5rem;
    }
}

/* Modo claro en Servicios: toda la zona subrayada (óvalos + contenido) con fondo blanco */
html:not([data-theme="dark"]) body.page-servicios .section-view {
    background: #FAFAFA;
}
html:not([data-theme="dark"]) body.page-servicios .section-content {
    background: #FAFAFA;
}

/* Sección superior: óvalos de servicios (estilo Proyectos). Modo claro = fondo blanco */
.section-services-top {
    flex: 0 0 auto;
    padding: 0.85rem 2rem 0.85rem; /* más espacio arriba y abajo de los tags */
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    z-index: 5;
    background: #FAFAFA;
    border-bottom: none;
}

/* En responsive, ocultar las tags superiores */
@media (max-width: 900px) {
    .section-services-top {
        display: none;
    }
}

.section-services-top .section-service-pill {
    padding: 0.6rem 1.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #313131;
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 999px;
    transition: all 0.22s ease;
}

.section-services-top .section-service-pill:hover {
    color: #313131;
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.section-services-top .section-service-pill.active {
    color: #313131;
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .section-services-top {
    background: transparent;
    border-bottom: none;
}

[data-theme="dark"] .section-services-top .section-service-pill {
    color: #fff;
    background: transparent;
    border: none;
}

[data-theme="dark"] .section-services-top .section-service-pill:hover,
[data-theme="dark"] .section-services-top .section-service-pill.active {
    background: rgba(255, 255, 255, 0.18);
    border: none;
    color: #fff;
}

[data-theme="dark"] .section-services-top .section-service-pill.active {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

/* Cuerpo: label vertical + contenido */
.section-view-body {
    flex: 1;
    display: flex;
    min-height: 0;
    overflow: hidden;
}

/* Label vertical "CIUDADES" / "INDUSTRIA" a la izquierda - fondo blanco con texto verde oscuro */
.section-label {
    flex-shrink: 0;
    width: 100px;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #FAFAFA;
    border-right: none;
}

.section-label-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.section-label-text {
    font-size: 1.75rem;
    font-weight: 700;
    color: #313131;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
    transform: rotate(-90deg);
    margin: 0;
    opacity: 0;
    animation: label-fade-in 0.35s ease-out 0.14s forwards;
}

.section-label-toggle {
    display: none; /* Oculto por defecto, visible solo en responsive */
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #313131;
    cursor: pointer;
    padding: 0.5rem;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.section-label-toggle-icon {
    width: 20px;
    height: 20px;
    color: #313131;
    transition: transform 0.3s ease;
}

[data-theme="dark"] .section-label-toggle-icon {
    color: #fff;
}

/* En responsive, el ícono del toggle debe ser blanco */
@media (max-width: 900px) {
    .section-label-toggle-icon {
        color: #fff;
    }
}

.section-label-toggle[aria-expanded="true"] .section-label-toggle-icon {
    transform: rotate(180deg);
}

.section-label-dropdown {
    display: none; /* Oculto por defecto */
    width: 100%;
    padding: 1rem;
    background: #313131;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.section-label-dropdown[aria-hidden="false"] {
    display: block;
}

/* Estilos para los pills dentro del dropdown */
.section-label-dropdown .section-service-pill {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fff;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    transition: all 0.22s ease;
    text-align: left;
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
}

.section-label-dropdown .section-service-pill:last-child {
    margin-bottom: 0;
}

.section-label-dropdown .section-service-pill:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateX(4px);
}

.section-label-dropdown .section-service-pill.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.section-services-top-mobile {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0;
}

.section-services-top-mobile .section-service-pill {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fff;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    transition: all 0.22s ease;
    text-align: left;
    text-decoration: none;
    display: block;
}

.section-services-top-mobile .section-service-pill:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateX(4px);
}

.section-services-top-mobile .section-service-pill.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

@keyframes label-fade-in {
    from {
        opacity: 0;
        transform: rotate(-90deg) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: rotate(-90deg) translateY(0);
    }
}

/* Contenido: paneles pegados; con has-expanded no hace wrap para ver la animación */
.section-content {
    position: relative;
    flex: 1;
    min-height: 0;
    height: 100%;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    align-items: stretch;
    justify-content: flex-start;
    background: #313131;
    overflow: hidden;
}

/* Tarjetas bajan del cielo al cargar / al entrar en vista */
.section-view:not(.section-cards-animated) .section-card {
    opacity: 0;
    transform: translateY(-100%);
}
.section-view.section-cards-animated .section-card {
    animation: section-card-fall 0.5s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
}
.section-view.section-cards-animated .section-card:nth-child(1) { animation-delay: 0.08s; }
.section-view.section-cards-animated .section-card:nth-child(2) { animation-delay: 0.22s; }
.section-view.section-cards-animated .section-card:nth-child(3) { animation-delay: 0.36s; }
.section-view.section-cards-animated .section-card:nth-child(4) { animation-delay: 0.5s; }
.section-view.section-cards-animated .section-card:nth-child(5) { animation-delay: 0.64s; }
.section-view.section-cards-animated .section-card:nth-child(6) { animation-delay: 0.78s; }
.section-view.section-cards-animated .section-card:nth-child(7) { animation-delay: 0.92s; }
.section-view.section-cards-animated .section-card:nth-child(8) { animation-delay: 1.06s; }
.section-view.section-cards-animated .section-card:nth-child(9) { animation-delay: 1.2s; }
.section-view.section-cards-animated .section-card:nth-child(10) { animation-delay: 1.34s; }
.section-view.section-cards-animated .section-card:nth-child(11) { animation-delay: 1.48s; }

@keyframes section-card-fall {
    0% {
        opacity: 0;
        transform: translateY(-100%);
    }
    70% {
        opacity: 1;
        transform: translateY(4%);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-card {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    height: 100%;
    border-radius: 0;
    overflow: hidden;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    transition: flex 0.28s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s ease;
    display: flex;
}

.section-card:hover .section-card-img {
    transform: scale(1.04);
}

/* Cuando hay una card expandida, las demás se encogen para que se vea la animación */
.section-content.has-expanded .section-card:not(.expanded) {
    flex: 0 0 0;
    min-width: 0;
    overflow: hidden;
    transition: flex 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-card.expanded {
    position: relative;
    z-index: 2;
    flex: 1 1 100%;
    min-width: 0;
    border-radius: 16px;
    transition: flex 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-card:last-child {
    border-right: none;
}

/* Vista cerrada: imagen + nombre */
.section-card-front {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.section-card.expanded .section-card-front {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.section-card-img {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-color: #313131;
    transition: transform 0.18s ease;
}

.section-card-img video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Overlay con degradado: transparencia y unión con sombras en la base */
.section-card-front::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.2) 40%, rgba(0, 0, 0, 0.75) 100%);
    pointer-events: none;
    z-index: 0;
}

.section-card-name {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 1.5rem 0.75rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.4) 70%, transparent 100%);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    line-height: 1.3;
    letter-spacing: 0.02em;
}

/* Vista expandida: carrusel izquierda + contenedor transparente (descripción) derecha */
.section-card-expanded {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0.75rem 0 0.75rem 0;
    background: transparent;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    border-radius: 16px;
    overflow: hidden;
    transition: opacity 0.2s ease 0.2s, visibility 0.2s ease 0.2s;
}

/* Overlay en modo claro: izquierda transparente sobre carrusel, derecha blanco sin sombra (modo oscuro en theme.css) */
.section-card-expanded::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.05) 30%, #FAFAFA 38%, #FAFAFA 100%);
    z-index: 0;
    pointer-events: none;
}

.section-card.expanded .section-card-expanded {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Botón cerrar (flechita): oculto por petición del usuario */
.section-card-back {
    display: none !important;
}

/* Columna izquierda: imagen 16:9 centrada */
.section-card-image-wrap {
    position: relative;
    flex: 1 1 42%;
    min-width: 0;
    max-width: 50%;
    padding: 0.15rem 1rem 0.3rem 1rem;
    z-index: 0.5;
    overflow: hidden;
    order: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto;
    aspect-ratio: 16/9;
    max-height: 100%;
    align-self: center;
}

.section-card-image {
    width: 100%;
    height: 100%;
    margin: auto;
    border-radius: 16px;
    object-fit: cover;
    object-position: center;
    display: block;
    background-color: #1a1a1a00;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Ecosistemas y Analítica: imagen completa dentro del margen 16:9, sin relleno ni zoom; borde como en panel de proyectos */
.section-card[data-servicio="webgis"] .section-card-image,
.section-card[data-servicio="geoespacial"] .section-card-image {
    object-fit: contain;
    object-position: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
html:not([data-theme="dark"]) .section-card[data-servicio="webgis"] .section-card-image,
html:not([data-theme="dark"]) .section-card[data-servicio="geoespacial"] .section-card-image {
    border-color: rgba(0, 0, 0, 0.12);
}

/* Regla específica para imágenes en industria - ocupan más espacio vertical, solo margen abajo */
.section-card[data-servicio="iot"] .section-card-image,
.section-card[data-servicio="control-ruido"] .section-card-image,
.section-card[data-servicio="clasificacion-fuentes"] .section-card-image,
.section-card[data-servicio="modelacion-ruido"] .section-card-image,
.section-card[data-servicio="holografia-acustica"] .section-card-image,
.section-card[data-servicio="medicion-vibraciones"] .section-card-image,
.section-card[data-servicio="modelacion-ruido-subacuatico"] .section-card-image,
.section-card[data-servicio="medicion-ruido-subacuatico"] .section-card-image,
.section-card[data-servicio="geoespacial"] .section-card-image,
.section-card[data-servicio="fotogrametria"] .section-card-image {
    width: 100%;
    height: 100%;
    margin: auto auto 0.75rem auto;
}

.section-card[data-servicio="iot"] .section-card-image-wrap,
.section-card[data-servicio="control-ruido"] .section-card-image-wrap,
.section-card[data-servicio="clasificacion-fuentes"] .section-card-image-wrap,
.section-card[data-servicio="modelacion-ruido"] .section-card-image-wrap,
.section-card[data-servicio="holografia-acustica"] .section-card-image-wrap,
.section-card[data-servicio="medicion-vibraciones"] .section-card-image-wrap,
.section-card[data-servicio="modelacion-ruido-subacuatico"] .section-card-image-wrap,
.section-card[data-servicio="medicion-ruido-subacuatico"] .section-card-image-wrap,
.section-card[data-servicio="geoespacial"] .section-card-image-wrap,
.section-card[data-servicio="fotogrametria"] .section-card-image-wrap {
    padding-bottom: 0.5rem;
    align-items: flex-start;
    padding-top: 0.25rem;
}

/* Control de ruido: encuadre para destacar la fachada del edificio principal */
.section-card[data-servicio="control-ruido"] .section-card-image {
    background-position: 55% 35%;
}

/* Videos ocupan todo el espacio */
.section-card-image video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Fondo más claro en modo claro */
html:not([data-theme="dark"]) .section-card-image {
    background-color: #f5f5f5;
}

.section-card-carousel-wrap {
    position: relative;
    flex: 1 1 42%;
    min-width: 0;
    max-width: 50%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.15rem 1rem 0.3rem 1rem;
    z-index: 0.5;
    overflow: hidden;
    order: 1;
    aspect-ratio: 16/9;
    max-height: 100%;
    height: auto;
    align-self: center;
}

/* Fondo suave detrás del carrusel (solo en esta columna) */
.section-card-carousel-bg {
    position: absolute;
    inset: -30px;
    z-index: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(14px);
    -webkit-filter: blur(14px);
    transform: scale(1.03);
}

.section-card-carousel-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.08);
}

.section-card-carousel-bg-video {
    position: absolute;
    inset: -20px;
    z-index: 0;
    filter: blur(20px);
    -webkit-filter: blur(20px);
    transform: scale(1.08);
}

.section-card-carousel-bg-video video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.section-card-carousel-wrap > *:not(.section-card-carousel-bg) {
    position: relative;
    z-index: 1;
}

/* Flechas carrusel: modo claro = blanco, sin sombra (en modo oscuro se sobrescribe en theme.css) */
.section-card-carousel-prev,
.section-card-carousel-next {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #FAFAFA;
    color: #313131;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
    box-shadow: none;
}

.section-card-carousel-prev:hover,
.section-card-carousel-next:hover {
    background: #F4F0EF;
    border-color: rgba(0, 0, 0, 0.15);
}

.section-card-carousel {
    flex: 1;
    min-width: 0;
    min-height: 200px;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: 16px;
    background: transparent;
    box-shadow: none;
}

.section-card-carousel-track {
    display: flex;
    gap: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: 16/9;
    min-height: 200px;
    transition: transform 0.18s ease;
}

.section-card-carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    min-height: 200px;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-color: #313131;
    object-fit: cover;
}

.section-card-carousel-slide-video {
    position: relative;
    overflow: hidden;
}

.section-card-carousel-slide-video video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Columna derecha: contenedor grande para descripción. Modo claro = blanco (modo oscuro en theme.css) */
.section-card-desc {
    position: relative;
    z-index: 2;
    flex: 1 1 58%;
    min-width: 320px;
    max-width: none;
    width: 100%;
    min-height: auto;
    max-height: none;
    align-self: center;
    margin: 0;
    padding: 1rem 2rem 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    text-align: left;
    -webkit-overflow-scrolling: touch;
    background: #FAFAFA;
    border: none;
    border-radius: 0;
    box-sizing: border-box;
    order: 2;
    opacity: 0;
    transform: translateX(24px);
    transition: opacity 0.2s ease 0.22s, transform 0.22s cubic-bezier(0.4, 0, 0.2, 1) 0.22s;
    box-shadow: none;
}

.section-card.expanded .section-card-desc,
.section-content .section-card.active-panel .section-card-desc {
    opacity: 1;
    transform: translateX(0);
}

/* En responsive, asegurar que la descripción siempre sea visible y esté en columna */
@media (max-width: 900px) {
    .section-card.expanded .section-card-expanded {
        display: flex !important;
        flex-direction: column !important;
    }
    
    .section-card.expanded .section-card-desc,
    .section-content .section-card.active-panel .section-card-desc,
    .section-card-desc {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateX(0) !important;
        display: block !important;
        position: relative !important;
    }
}

.section-card-desc-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #313131;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 1.5rem 0 0.75rem 0;
    line-height: 1.2;
}

.section-card-desc p {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    line-height: 1.7;
    color: #313131;
    max-width: 56em;
}

.section-card-proyectos-link {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--geo-military-green);
    text-decoration: none;
    border: 2px solid var(--geo-military-green);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    transition: background 0.2s, color 0.2s;
    margin-bottom: 2.5rem;
}

.section-card-proyectos-link:hover {
    background: var(--geo-military-green-hover-bg);
    color: var(--geo-military-green);
}

/* Enlace "Ver proyectos" en modo claro: verde militar (en modo oscuro se sobrescribe en theme.css) */
.section-card-desc .section-card-proyectos-link {
    color: var(--geo-military-green);
    border-color: var(--geo-military-green);
}

.section-card-desc .section-card-proyectos-link:hover {
    background: var(--geo-military-green-hover-bg);
    color: var(--geo-military-green);
    border-color: var(--geo-military-green);
}

.section-card-proyectos-link--disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}
.section-card-proyectos-link--disabled:hover {
    background: transparent !important;
    color: inherit !important;
    border-color: inherit !important;
}

@media (max-width: 900px) {
    .section-view {
        flex-direction: column;
        padding-top: 0; /* Sin padding extra en móvil */
    }

    /* Orden en pantalla pequeña: tags → título (CIUDADES/INDUSTRIA) → carrusel → descripción */
    .section-view-body {
        flex-direction: column;
        overflow-y: auto;
    }

    /* Título CIUDADES/INDUSTRIA justo debajo de los tags, siempre visible */
    .section-label {
        width: 100%;
        min-height: auto;
        height: auto;
        flex-shrink: 0;
        order: -1;
        border-right: none;
        border-bottom: none;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        margin-top: 0;
    }

    .section-label-header {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 0.5rem 1.5rem;
        position: relative;
        background: #313131;
    }

    .section-label-text {
        transform: none;
        font-size: 1.35rem;
        font-weight: 700;
        opacity: 1;
        animation: none;
        margin: 0;
        color: #fff;
    }

    .section-label-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: static;
        transform: none;
        margin-left: 1rem;
    }

    .section-label-dropdown {
        display: none;
        padding: 1rem 1.5rem;
        background: #313131;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .section-label-dropdown[aria-hidden="false"] {
        display: block;
    }

    .section-content {
        height: auto;
        min-height: 70vh;
        flex-wrap: wrap;
        justify-content: center;
        padding: 0.5rem;
        gap: 0.5rem;
        margin-top: 1.25rem;
    }

    .section-card {
        flex: 1 1 160px;
        max-width: 200px;
        min-height: 320px;
        height: 320px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }

    .section-card.expanded {
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        width: 100%;
        z-index: 2;
        flex: none;
        min-height: 100%;
        height: 100%;
    }
    
    /* Asegurar que el contenedor expandido ocupe todo el espacio disponible */
    .section-card.expanded .section-card-expanded {
        height: 100%;
        min-height: 100%;
    }

    .section-card-expanded {
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 0.5rem 1rem;
        overflow-y: auto;
        gap: 0;
    }

    /* Imagen arriba - más pequeña en móvil */
    .section-card-image-wrap {
        flex: 0 0 auto;
        max-width: 100%;
        width: 100%;
        min-height: 200px;
        max-height: 250px;
        height: auto;
        padding: 0 1rem 0.5rem 1rem;
        order: 1;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .section-card-image {
        width: 100%;
        height: 100%;
        max-height: 250px;
        min-height: 200px;
        object-fit: cover;
        border-radius: 12px;
        margin: 0;
    }

    .section-card[data-servicio="webgis"] .section-card-image,
    .section-card[data-servicio="geoespacial"] .section-card-image {
        object-fit: contain;
    }

    .section-card-image video {
        width: 100%;
        height: 100%;
        max-height: 250px;
        min-height: 200px;
        object-fit: cover;
        border-radius: 12px;
    }

    /* Carrusel también más pequeño */
    .section-card-carousel-wrap {
        flex: 0 0 auto;
        max-width: 100%;
        width: 100%;
        min-height: 200px;
        max-height: 250px;
        height: auto;
        padding: 0 1rem 0.5rem 1rem;
        order: 1;
    }

    .section-card-carousel {
        height: 200px;
        min-height: 200px;
        max-height: 250px;
    }

    .section-card-carousel-track,
    .section-card-carousel-slide {
        min-height: 200px;
        height: 200px;
    }

    /* Descripción abajo - siempre visible */
    .section-card-desc {
        flex: 1 1 auto;
        min-height: auto;
        max-height: none;
        width: 100%;
        padding: 0;
        margin: 0;
        order: 2;
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateX(0) !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    .section-card-desc-title {
        font-size: 1.4rem;
        margin: 1.5rem 0 1rem 0;
        padding: 0 1.25rem;
        line-height: 1.3;
    }

    .section-card-desc p {
        font-size: 0.95rem;
        line-height: 1.6;
        margin: 0 0 1.5rem 0;
        padding: 0 1.25rem;
    }

    .section-card-proyectos-link {
        display: inline-block !important;
        margin: 0.5rem 1.25rem 2.5rem 1.25rem;
        width: auto;
    }

    .section-card:last-child {
        border-bottom: none;
    }
}

/* Más margin-top al contenido en móviles para que no quede pegado al selector */
@media (max-width: 560px) {
    .section-content {
        margin-top: 1.5rem;
    }
}
@media (max-width: 430px) {
    .section-content {
        margin-top: 1.5rem;
    }
}

/* Navbar blanco en modo claro solo en Servicios (Ciudades / Industria). Modo oscuro: theme.css [data-theme="dark"] */
body.page-servicios .navbar,
body.page-servicios .navbar.scrolled {
    background: #FAFAFA;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: none;
}

body.page-servicios .navbar.scrolled .logo {
    color: #313131;
}

body.page-servicios .navbar .logo-img,
body.page-servicios .navbar.scrolled .logo-img {
    filter: brightness(0) invert(1) !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    width: auto !important;
    height: 48px !important;
    max-width: 240px !important;
}

body.page-servicios .navbar.scrolled .nav-links a,
body.page-servicios .navbar.scrolled .nav-dropdown-toggle {
    color: #313131;
}

body.page-servicios .navbar.scrolled .nav-dropdown-menu {
    background: #FAFAFA;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

body.page-servicios .navbar.scrolled .nav-dropdown-menu a {
    color: #313131;
}

body.page-servicios .navbar.scrolled .nav-dropdown-menu a:hover {
    background: rgba(0, 0, 0, 0.06);
}

body.page-servicios .navbar.scrolled .nav-theme-btn {
    color: #313131;
    background: rgba(0, 0, 0, 0.06);
}
body.page-servicios .navbar.scrolled .nav-theme-btn:hover {
    background: rgba(0, 0, 0, 0.12);
}

/* Hamburguesa blanco en servicios (tanto modo oscuro como claro cuando el navbar es oscuro) */
body.page-servicios .navbar .nav-hamburger-bar,
body.page-servicios .navbar.scrolled .nav-hamburger-bar {
    background: #fff !important;
}

/* En modo claro, el navbar es blanco, así que el hamburguesa debe ser oscuro */
html:not([data-theme="dark"]) body.page-servicios .navbar.scrolled .nav-hamburger-bar {
    background: #313131 !important;
}

/* Solo paneles: no hay cards, solo un panel visible; el título vertical (Ciudades/Industria) siempre se ve */
.section-content .section-card {
    display: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    flex: none;
    min-width: 100%;
    border: none;
}

.section-content .section-card.active-panel {
    display: flex;
    z-index: 1;
    animation: none;
    opacity: 1;
    transform: none;
}

.section-content .section-card.active-panel .section-card-expanded {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Barra inferior (legacy): oculta; los óvalos están en .section-services-top */
.section-services-bar {
    display: none;
}

.section-service-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #fff;
    text-decoration: none;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    background: transparent;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    white-space: nowrap;
}

.section-service-pill:hover,
.section-service-pill.active {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.75);
    color: #fff;
}

.section-service-pill.active {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .section-services-bar {
    background: rgba(15, 28, 24, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .section-service-pill {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: #fff;
}

[data-theme="dark"] .section-service-pill:hover,
[data-theme="dark"] .section-service-pill.active {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.75);
}

[data-theme="dark"] .section-service-pill.active {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
}

/* Surface Pro 7 (912 x 1368) SOLO: imagen arriba, texto abajo - siempre visible */
@media (min-width: 900px) and (max-width: 950px) {
    /* Hacer que el contenido expandido siempre esté visible */
    .section-card .section-card-expanded {
        opacity: 1 !important; /* Siempre visible */
        visibility: visible !important; /* Siempre visible */
        pointer-events: auto !important; /* Interactivo */
        flex-direction: column !important; /* Columna: imagen arriba, texto abajo */
        display: flex !important;
        position: relative !important; /* Cambiar de absolute a relative para que siempre esté visible */
    }
    
    /* Ocultar la vista frontal (imagen con nombre) */
    .section-card .section-card-front {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
    
    .section-card-image-wrap {
        order: 1 !important; /* Imagen primero (arriba) */
        flex: 0 0 auto !important;
        max-width: 100% !important;
        width: 100% !important;
        padding: 1rem 1.5rem 0.5rem !important;
    }
    
    .section-card-desc {
        order: 2 !important; /* Texto segundo (abajo) */
        flex: 0 0 auto !important;
        max-width: 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        padding: 1rem 1.5rem 1.5rem !important;
        opacity: 1 !important; /* Siempre visible */
        visibility: visible !important; /* Siempre visible */
        transform: translateX(0) !important; /* Sin animación */
    }
}

/* iPad Pro (1024 x 1366) SOLO: imagen arriba, texto abajo - siempre visible */
@media (min-width: 1024px) and (max-width: 1100px) {
    /* Hacer que el contenido expandido siempre esté visible */
    .section-card .section-card-expanded {
        opacity: 1 !important; /* Siempre visible */
        visibility: visible !important; /* Siempre visible */
        pointer-events: auto !important; /* Interactivo */
        flex-direction: column !important; /* Columna: imagen arriba, texto abajo */
        display: flex !important;
        position: relative !important; /* Cambiar de absolute a relative para que siempre esté visible */
    }
    
    /* Ocultar la vista frontal (imagen con nombre) */
    .section-card .section-card-front {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
    
    .section-card-image-wrap {
        order: 1 !important; /* Imagen primero (arriba) */
        flex: 0 0 auto !important;
        max-width: 100% !important;
        width: 100% !important;
        padding: 1rem 1.5rem 0.5rem !important;
    }
    
    .section-card-desc {
        order: 2 !important; /* Texto segundo (abajo) */
        flex: 0 0 auto !important;
        max-width: 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        padding: 1rem 1.5rem 1.5rem !important;
        opacity: 1 !important; /* Siempre visible */
        visibility: visible !important; /* Siempre visible */
        transform: translateX(0) !important; /* Sin animación */
    }
}