/* Property Gallery Styling */
.property-gallery {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
}

.gallery-container {
    position: relative;
    width: 100%;
    height: 600px;
    overflow: hidden;
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.10);
}

.gallery-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-slide.active {
    opacity: 1;
    z-index: 1;
}

.gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 24px;
}

.gallery-thumbnails {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    padding: 20px 0 10px 0;
    background: transparent;
    max-height: 120px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: #666 #eee;
    position: relative;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.gallery-thumbnails::-webkit-scrollbar {
    height: 8px;
}

.gallery-thumbnails::-webkit-scrollbar-track {
    background: #eee;
}

.gallery-thumbnails::-webkit-scrollbar-thumb {
    background-color: #666;
    border-radius: 4px;
}

.gallery-thumbnail {
    flex: 0 0 auto;
    width: 70px;
    height: 56px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s, border-color 0.3s;
    border: 2px solid transparent;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.gallery-thumbnail.active {
    opacity: 1;
    border-color: #515a49;
}

.gallery-thumbnail:hover {
    opacity: 0.8;
}

/* Optional: Add left/right arrows for thumbnail scroll */
.gallery-thumbnails-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 100%;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}
.gallery-thumbnails-arrow {
    background: rgba(255,255,255,0.8);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    cursor: pointer;
    pointer-events: auto;
    font-size: 18px;
    color: #515a49;
    transition: background 0.2s;
}
.gallery-thumbnails-arrow:hover {
    background: #eee;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 2;
}

.gallery-prev,
.gallery-next {
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.gallery-prev:hover,
.gallery-next:hover {
    background: rgba(0, 0, 0, 0.8);
}

.gallery-counter {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 2;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .gallery-container {
        height: 50vh;
        min-height: 300px;
        border-radius: 16px;
        margin-bottom: 10px;
    }
    
    .gallery-slide img {
        border-radius: 16px;
    }
    
    .gallery-thumbnails {
        padding: 10px 0;
        max-height: 90px;
        gap: 8px;
    }
    
    .gallery-thumbnail {
        width: 60px;
        height: 45px;
        border-radius: 8px;
        border-width: 1px;
        min-width: 60px; /* Ensures consistent sizing on mobile */
    }
    
    .gallery-thumbnail img {
        border-radius: 8px;
    }
    
    .gallery-nav {
        padding: 0 10px;
    }
    
    .gallery-prev,
    .gallery-next {
        width: 40px;
        height: 40px;
    }
    
    /* Improved touch targets for mobile */
    .gallery-thumbnail {
        min-height: 44px;
    }
    
    .gallery-prev,
    .gallery-next,
    .gallery-thumbnails-arrow {
        min-width: 44px;
        min-height: 44px;
    }
}

@media (max-width: 480px) {
    .gallery-container {
        height: 40vh;
        min-height: 250px;
        border-radius: 12px;
    }
    
    .gallery-slide img {
        border-radius: 12px;
    }
    
    .gallery-thumbnails {
        padding: 8px 0;
        max-height: 70px;
        gap: 6px;
    }
    
    .gallery-thumbnail {
        width: 50px;
        height: 38px;
        min-width: 50px;
    }
    
    .gallery-prev,
    .gallery-next {
        width: 36px;
        height: 36px;
        font-size: 1.4rem;
    }
    
    .gallery-counter {
        bottom: 10px;
        right: 10px;
        padding: 4px 8px;
        font-size: 12px;
    }
    
    /* Show fewer thumbnails on very small screens */
    .gallery-thumbnails {
        justify-content: flex-start;
    }
}

/* Fullscreen gallery for touch swipe on mobile */
.gallery-fullscreen-toggle {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background-color 0.3s ease;
}

.gallery-fullscreen-toggle:hover {
    background: rgba(0, 0, 0, 0.9);
}

@media (max-width: 480px) {
    .gallery-fullscreen-toggle {
        bottom: 10px;
        left: 10px;
        width: 36px;
        height: 36px;
    }
} 