/* Lightbox gallery styles (scope local a esta página) */
.lightbox {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.88);
    z-index: 12000;
    padding: 20px;
    opacity: 0;
    transition: opacity .24s ease;
}

.lightbox[aria-hidden="false"] {
    opacity: 1;
}

/* Ensure hidden lightbox does not block pointer events or affect layout */
.lightbox[aria-hidden="true"],
.lightbox[hidden] {
    pointer-events: none;
    visibility: hidden;
    display: none;
}

.lightbox[aria-hidden="false"] {
    pointer-events: auto;
    visibility: visible;
    display: flex;
}

.lb-content {
    position: relative;
    max-width: 1100px;
    width: 100%;
    max-height: 92vh;
    display: flex;
    align-items: center;
    justify-content: center
}

.lb-image {
    max-width: 100%;
    max-height: 82vh;
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    display: block;
    transform: scale(.98);
    transition: transform .28s cubic-bezier(.2, .9, .2, 1), opacity .2s ease;
    opacity: 0;
}

/* ensure image is below UI controls */
.lb-image {
    z-index: 1;
}

.lb-close,
.lb-prev,
.lb-next {
    position: absolute;
    top: 12px;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(6px);
    transition: background .15s ease, transform .12s ease;
}

/* UI controls must sit above the image */
.lb-close,
.lb-prev,
.lb-next,
.lb-download {
    z-index: 12010;
}

.lb-close {
    right: 12px;
    font-size: 28px
}

.lb-prev,
.lb-next {
    top: 50%;
    transform: translateY(-50%);
    font-size: 40px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lb-prev {
    left: 6px
}

.lb-next {
    right: 6px
}

.lb-download {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600
}

.lb-download:focus,
.lb-close:focus,
.lb-prev:focus,
.lb-next:focus {
    outline: 3px solid rgba(56, 189, 248, 0.22);
    outline-offset: 4px;
}

.lb-close:hover,
.lb-prev:hover,
.lb-next:hover,
.lb-download:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px)
}

/* When image has loaded, animate it in */
.lb-image[data-loaded="1"] {
    opacity: 1;
    transform: scale(1)
}

/* caption placeholder (optional) */
.lb-caption {
    position: absolute;
    left: 12px;
    bottom: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    background: rgba(0, 0, 0, 0.28);
    padding: 8px 10px;
    border-radius: 8px
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}

/* Promo iframe: aspecto responsivo, overlay y CTAs */
.promo-iframe {
    position: relative;
    padding-top: 56.25%;
    /* 16:9 */
    width: 100%;
    margin: 18px 0 28px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.6);
    background: #000;
}

.promo-iframe iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.promo-overlay {
    position: absolute;
    inset: auto 12px 12px 12px;
    z-index: 3;
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
}

.promo-text {
    color: #fff;
    text-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
    max-width: 70%;
    pointer-events: auto;
}

.promo-text h4 {
    margin: 0 0 6px;
    font-size: 1.15rem
}

.promo-text p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem
}

.promo-cta {
    pointer-events: auto;
    display: flex;
    gap: 10px
}

.promo-cta .btn-hero {
    padding: 10px 16px;
    font-size: 0.95rem
}

@media (max-width:800px) {
    .promo-overlay {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px
    }

    .promo-text {
        max-width: 100%
    }
}

.gallery-item {
    cursor: pointer;
    overflow: hidden;
    border-radius: 8px
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .25s ease
}

.gallery-item:hover img {
    transform: scale(1.05)
}

@media (max-width:600px) {

    .lb-prev,
    .lb-next {
        font-size: 32px
    }

    .lb-close {
        font-size: 22px
    }
}

@media (max-width:480px) {
    .lb-content {
        max-width: 94vw
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr)
    }
}

/* Starlink page hero */
.starlink-hero {
    background: linear-gradient(180deg, #07142a 0%, rgba(7, 20, 42, 0.6) 60%);
    padding: 36px 22px;
    border-radius: 14px;
    margin-bottom: 28px;
    color: #e6eefb;
}

.starlink-hero .hero-inner {
    display: flex;
    gap: 28px;
    align-items: center
}

.starlink-hero .hero-copy {
    flex: 1
}

.starlink-hero h1 {
    font-size: 1.9rem;
    margin: 0 0 8px
}

.starlink-hero p {
    margin: 0 0 12px;
    color: rgba(230, 238, 251, 0.9)
}

.starlink-hero .hero-stats {
    display: flex;
    gap: 18px;
    margin-top: 12px
}

.starlink-hero .hero-stats div {
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 12px;
    border-radius: 10px;
    font-weight: 600
}

.starlink-hero .hero-graphics {
    width: 320px;
    flex-shrink: 0
}

.starlink-hero .hero-graphics img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 14px 40px rgba(2, 6, 23, 0.6)
}

/* Floating CTA */
.floating-cta {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 15000
}

.floating-cta .btn-hero {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 999px
}

@media (max-width:900px) {
    .starlink-hero .hero-inner {
        flex-direction: column
    }

    .starlink-hero .hero-graphics {
        width: 100%
    }
}

/* Subtle entrance for sections */
.fade-up {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .6s ease, transform .6s ease
}

.fade-up.in-view {
    opacity: 1;
    transform: none
}

/* GPS section responsive tweaks */
.gps-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    /* fallback for pages that keep inline styles */
    gap: 28px;
    align-items: start;
    margin-bottom: 22px;
}

.wifi-actions {
    margin-bottom: 22px;
}

@media (max-width: 900px) {
    .gps-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .gps-actions .section-header {
        margin-bottom: 6px;
    }

    .gps-grid>div:first-child {
        order: 1;
    }

    .gps-grid aside {
        order: 2;
        width: 100%;
        text-align: center;
    }

}

/* Ajustes específicos para la sección de Redes WiFi: mejor espaciado y lectura en móvil */
.wifi-grid>div{
    padding: 6px 4px 0 4px;
    max-width: 820px;
    margin: 0 auto;
}

.wifi-grid .section-header{
    text-align: left;
    padding: 8px 0 6px 0;
}

.wifi-grid .section-header h3{
    margin: 0 0 14px 0;
}

.wifi-grid ul.muted{
    margin-left: 18px;
    margin-top: 6px;
    color: rgba(255,255,255,0.88);
}

@media (max-width:600px){
    .wifi-grid>div{
        padding: 0;
        max-width: 100%;
    }

    .section-header h2{
        font-size: 1.6rem;
    }
}

    .gps-grid aside>div {
        padding: 16px;
        border-radius: 12px;
    }

    .gps-grid .btn-hero {
        display: inline-block;
        width: 100%;
        max-width: 420px;
        box-sizing: border-box;
        padding: 12px 18px;
        font-size: 1rem;
    }

    .gps-grid ul.muted {
        padding-left: 18px;
        margin: 0 6px;
    }
}

/* Small polish for very narrow screens */
@media (max-width: 420px) {
    .gps-grid .btn-hero {
        padding: 12px 14px;
        font-size: 0.98rem
    }

    .gps-grid aside>div {
        padding: 14px
    }
}

/* Mobile-specific refinements */
@media (max-width: 600px) {
    .services-modern {
        padding: 28px 14px;
    }

    .section-header {
        text-align: left;
        padding: 8px 6px;
        margin-bottom: 18px;
    }

    .section-header h2 {
        font-size: 1.4rem;
    }

    .section-header p {
        font-size: 0.95rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .service-item {
        padding: 16px;
        border-radius: 12px;
    }

    .service-item h4 {
        font-size: 1.05rem;
        margin-bottom: 8px;
    }

    .service-item p {
        font-size: 0.95rem;
        line-height: 1.5;
    }

    /* Ensure two-column action grids collapse cleanly */
    .gps-grid,
    .wifi-grid,
    .monitoreo-grid,
    .control-grid,
    .solar-grid,
    .baterias-grid,
    .internet-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 20px;
    }

    .gps-grid aside>div,
    .wifi-grid aside>div,
    .control-grid aside>div {
        padding: 14px;
    }

    /* Make CTAs touch-friendly */
    .btn-hero,
    .btn-service {
        display: inline-flex;
        width: 100%;
        padding: 12px 16px;
        font-size: 1rem;
        box-sizing: border-box;
    }

    /* Slightly denser gallery on small devices */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .container {
        padding-left: 14px;
        padding-right: 14px;
    }
}