/**
 * Apartment Type Gallery Styles
 */

.apt-type-gallery {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
}

/* ═══ TABS ═══ */
.apt-type-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e8e6e1;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.apt-type-tabs::-webkit-scrollbar {
    display: none;
}

.apt-type-tab {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    border: none;
    background: transparent;
    color: #9e9a92;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    position: relative;
    margin-bottom: -2px;
    border-bottom: 2px solid transparent;
}

.apt-type-tab:hover {
    color: #6b6963;
}

.apt-type-tab.active {
    color: #2c5f45;
    border-bottom-color: #2c5f45;
    font-weight: 600;
}

/* ═══ CONTENT ═══ */
.apt-type-content {
    display: none;
}

.apt-type-content.active {
    display: block;
    animation: aptFadeIn 0.3s ease;
}

@keyframes aptFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ═══ GRID ═══ */
.apt-type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.apt-type-grid-item {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    background: #f0efec;
}

.apt-type-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.apt-type-grid-item:hover img {
    transform: scale(1.05);
}

/* Tablet - 2 columns */
@media (max-width: 991px) {
    .apt-type-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* Mobile - 1 column */
@media (max-width: 767px) {
    .apt-type-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .apt-type-tab {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* ═══ LIGHTBOX ═══ */
.apt-type-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(26, 26, 24, 0.95);
    backdrop-filter: blur(4px);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    animation: aptLightboxIn 0.2s ease;
}

.apt-type-lightbox.open {
    display: flex;
}

@keyframes aptLightboxIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.apt-type-lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.apt-type-lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    animation: aptImageIn 0.2s ease;
}

@keyframes aptImageIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Close button */
.apt-type-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
}

.apt-type-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Navigation arrows */
.apt-type-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    user-select: none;
}

.apt-type-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.25);
}

.apt-type-lightbox-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.apt-type-lightbox-prev {
    left: 20px;
}

.apt-type-lightbox-next {
    right: 20px;
}

/* Counter */
.apt-type-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 13px;
    border-radius: 100px;
    font-variant-numeric: tabular-nums;
}

/* Mobile lightbox */
@media (max-width: 767px) {
    .apt-type-lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    .apt-type-lightbox-prev {
        left: 10px;
    }
    
    .apt-type-lightbox-next {
        right: 10px;
    }
    
    .apt-type-lightbox-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        font-size: 24px;
    }
    
    .apt-type-lightbox-counter {
        bottom: 10px;
        font-size: 12px;
    }
}
