/* Base carousel container */
.hcg-carousel {
    position: relative;
    width: 100%;
    margin: 20px 0;
    background-color: #f9f9f9;
    border-radius: 8px;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    gap: 15px;
    padding: 0;
}

/* Ensure scrollbar styling */
.hcg-carousel::-webkit-scrollbar {
    height: 8px;
}

.hcg-carousel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.hcg-carousel::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.hcg-carousel::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Gallery items */
.hcg-cell {
    display: block;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    border-radius: 8px;
    overflow: hidden;
}

/* Links inside cells */
.hcg-cell a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.hcg-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    margin: 0;
    padding: 0;
}

.hcg-cell:hover .hcg-image {
    transform: scale(1.05);
}

/* ===== ASPECT RATIO DEFINITIONS ===== */
.hcg-ratio-16-9 {
    aspect-ratio: 16 / 9;
}

.hcg-ratio-4-3 {
    aspect-ratio: 4 / 3;
}

.hcg-ratio-1-1 {
    aspect-ratio: 1 / 1;
}

.hcg-ratio-3-2 {
    aspect-ratio: 3 / 2;
}

.hcg-ratio-21-9 {
    aspect-ratio: 21 / 9;
}

.hcg-ratio-9-16 {
    aspect-ratio: 9 / 16;
}

/* ===== MOBILE LAYOUT: 1 item visible ===== */
@media (max-width: 767px) {
    .hcg-carousel {
        margin: 15px 0;
        gap: 0;
    }
    
    .hcg-cell {
        width: 100vw;
        max-width: 100vw;
        flex-shrink: 0;
    }
}

/* ===== TABLET/DESKTOP LAYOUT: ~3 items visible ===== */
@media (min-width: 768px) {
    .hcg-cell {
        width: calc(33.333% - 10px);
        min-width: calc(33.333% - 10px);
        flex-shrink: 0;
    }
}

/* Container with arrows */
.hcg-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
}

/* Arrow buttons */
.hcg-arrow {
    position: relative;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    padding: 0;
    background-color: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.hcg-arrow:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.hcg-arrow:active {
    transform: scale(0.95);
}

.hcg-arrow:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Mobile: Hide arrows on small screens */
@media (max-width: 767px) {
    .hcg-arrow {
        display: none;
    }
    
    .hcg-container {
        gap: 0;
    }
}
