/* ====== APARTMENT DETAIL PAGES ====== */
.apt-hero { position: relative; height: 70vh; min-height: 500px; overflow: hidden; }
.apt-hero-slider { position: absolute; inset: 0; }
.apt-hero-slide {
    position: absolute; inset: 0;
    opacity: 0; transition: opacity 1s ease;
}
.apt-hero-slide.active { opacity: 1; }
.apt-hero-slide img { width: 100%; height: 100%; object-fit: cover; }
.apt-hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(13,43,66,0.3) 0%, rgba(13,43,66,0.6) 100%);
    z-index: 1;
    pointer-events: none;
}
.apt-hero-content {
    position: relative; z-index: 2;
    display: flex; flex-direction: column; justify-content: flex-end;
    height: 100%; padding: 3rem; color: white;
    max-width: var(--container); margin: 0 auto;
    pointer-events: none;
}
.apt-hero-content .back-link,
.apt-hero-content .apt-hero-badge,
.apt-hero-content h1,
.apt-hero-content .apt-hero-sub {
    pointer-events: auto;
}
.apt-hero-content .back-link {
    position: absolute; top: calc(var(--header-height) + 1rem); left: 2rem;
    color: rgba(255,255,255,0.8); font-size: 0.85rem; font-weight: 500;
    display: flex; align-items: center; gap: 0.5rem;
    transition: color 0.3s;
}
.apt-hero-content .back-link:hover { color: white; }
.apt-hero-badge {
    display: inline-block;
    color: white;
    padding: 0.35rem 1rem; border-radius: 20px;
    font-size: 0.75rem; font-weight: 600;
    margin-bottom: 1rem; width: fit-content;
}
.apt-hero-badge.sea { background: var(--sea); }
.apt-hero-badge.olive { background: var(--olive); }
.apt-hero-content h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1; margin-bottom: 0.75rem;
}
.apt-hero-content .apt-hero-sub {
    font-size: 1.1rem; opacity: 0.85; max-width: 600px;
}
.apt-hero-nav {
    position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
    z-index: 3; display: flex; gap: 0.5rem;
}
.apt-hero-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: rgba(255,255,255,0.3); cursor: pointer;
    transition: all 0.3s;
}
.apt-hero-dot.active { background: white; transform: scale(1.3); }
.apt-hero-arrows {
    position: absolute; z-index: 3;
    top: 50%; width: 100%;
    display: flex; justify-content: space-between;
    padding: 0 1.5rem; pointer-events: none;
}
.apt-hero-arrows button {
    pointer-events: auto;
    width: 48px; height: 48px; border-radius: 50%;
    background: rgba(255,255,255,0.2); backdrop-filter: blur(8px);
    color: white; font-size: 1.5rem;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s; border: 1px solid rgba(255,255,255,0.2);
}
.apt-hero-arrows button:hover { background: rgba(255,255,255,0.35); }

/* Detail section */
.apt-detail { padding: 5rem 0; }
.apt-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; }
.apt-detail-text h2 {
    font-size: 2rem; color: var(--sea-deep); margin-bottom: 1.5rem;
}
.apt-detail-text p {
    font-size: 1rem; line-height: 1.85; color: var(--text-light);
    margin-bottom: 1.25rem;
}

/* Services */
.apt-services { padding: 4rem 0; background: var(--sand); }
.services-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem; margin-top: 3rem;
}
.service-item {
    background: var(--white); padding: 2rem; border-radius: var(--radius);
    border: 1px solid rgba(0,0,0,0.04);
    text-align: center; transition: all var(--transition);
}
.service-item:hover { transform: translateY(-4px); box-shadow: 0 10px 30px var(--shadow-lg); }
.service-item .s-icon {
    width: 56px; height: 56px; background: var(--sand);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem; font-size: 1.5rem;
}
.service-item h4 { font-family: var(--font-body); font-size: 0.95rem; font-weight: 600; color: var(--sea-deep); margin-bottom: 0.3rem; }
.service-item p { font-size: 0.8rem; color: var(--text-muted); }

/* CTA */
.apt-book-cta {
    padding: 5rem 0; text-align: center; color: white;
}
.apt-book-cta.sea { background: linear-gradient(135deg, var(--sea-deep), var(--sea)); }
.apt-book-cta.olive { background: linear-gradient(135deg, var(--olive), var(--olive-light)); }
.apt-book-cta h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 1rem; color: white;
}
.apt-book-cta p {
    font-size: 1.1rem; opacity: 0.85; margin-bottom: 2rem;
    max-width: 500px; margin-left: auto; margin-right: auto;
}

/* Thumbnails */
.thumb-strip {
    display: flex; gap: 0.5rem; overflow-x: auto;
    padding: 1rem 0; scrollbar-width: thin;
}
.thumb-strip img {
    height: 80px; width: 120px; object-fit: cover;
    border-radius: 8px; cursor: zoom-in; opacity: 0.6;
    transition: all 0.3s; border: 2px solid transparent; flex-shrink: 0;
}
.thumb-strip img.active, .thumb-strip img:hover { opacity: 1; }
.thumb-strip img.active { border-color: var(--terracotta); }

/* Checklist items */
.checklist-item {
    display: flex; align-items: center; gap: 0.6rem;
    background: var(--sand); padding: 0.75rem 1.25rem;
    border-radius: 10px; font-size: 0.9rem; color: var(--text-light);
    margin-bottom: 0.6rem;
}
.checklist-icon { flex-shrink: 0; }

/* Responsive */
@media (max-width: 768px) {
    .apt-hero { height: 60vh; }
    .apt-detail-grid { grid-template-columns: 1fr; gap: 2rem; }
    .apt-hero-content { padding: 2rem; }
}

/* ==========================================================
   LIGHTBOX GALLERY — fullscreen con thumbnail strip in alto
   ========================================================== */
.apt-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.96);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}
.apt-lightbox.active {
    opacity: 1;
    visibility: visible;
}

/* --- TOP: thumbnail strip + close button --- */
.apt-lb-top {
    position: relative;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.75rem 3.5rem 0.75rem 1rem;
}

.apt-lb-thumbs-wrap {
    overflow: hidden;
    width: 100%;
}

.apt-lb-thumbs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.25) transparent;
    padding: 0.25rem 0;
    scroll-behavior: smooth;
}

.apt-lb-thumbs::-webkit-scrollbar { height: 4px; }
.apt-lb-thumbs::-webkit-scrollbar-track { background: transparent; }
.apt-lb-thumbs::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

.apt-lb-thumbs img {
    flex-shrink: 0;
    width: 90px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.4;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.apt-lb-thumbs img:hover {
    opacity: 0.8;
}

.apt-lb-thumbs img.active {
    opacity: 1;
    border-color: var(--terracotta, #c4704b);
    box-shadow: 0 0 12px rgba(196, 112, 75, 0.5);
}

/* Close button */
.apt-lb-close {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    line-height: 1;
}
.apt-lb-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

/* --- MAIN: immagine grande + frecce --- */
.apt-lb-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 0;
    padding: 1rem;
}

.apt-lb-img-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    cursor: default;
}

.apt-lb-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
    user-select: none;
    transition: opacity 0.2s ease;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.apt-lb-img-fade {
    opacity: 0;
}

/* Navigation arrows */
.apt-lb-nav {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 0.75rem;
    z-index: 2;
}
.apt-lb-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.3);
}

/* --- BOTTOM: counter --- */
.apt-lb-bottom {
    flex-shrink: 0;
    text-align: center;
    padding: 0.75rem;
}

.apt-lb-counter {
    color: rgba(255, 255, 255, 0.5);
    font-family: var(--font-body, 'Montserrat', sans-serif);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 2px;
}

/* ---- Lightbox Responsive ---- */
@media (max-width: 768px) {
    .apt-lb-top {
        padding: 0.5rem 3rem 0.5rem 0.5rem;
    }

    .apt-lb-thumbs img {
        width: 64px;
        height: 44px;
        border-radius: 4px;
    }

    .apt-lb-nav {
        width: 40px;
        height: 40px;
        margin: 0 0.35rem;
    }

    .apt-lb-nav svg {
        width: 20px;
        height: 20px;
    }

    .apt-lb-close {
        width: 34px;
        height: 34px;
        font-size: 1.2rem;
    }

    .apt-lb-main {
        padding: 0.5rem;
    }

    .apt-lb-img {
        border-radius: 4px;
    }
}

@media (max-width: 480px) {
    .apt-lb-thumbs img {
        width: 52px;
        height: 36px;
    }

    .apt-lb-thumbs {
        gap: 0.35rem;
    }

    .apt-lb-nav {
        width: 36px;
        height: 36px;
        margin: 0 0.2rem;
    }
}