/* 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: 100%;
        max-width: 100%;
        flex-shrink: 0;
    }

    .hcg-search-toggle,
    .hcg-search-input {
        top: 25px;
    }

    .hcg-cell-actions {
        opacity: 1;
        pointer-events: auto;
    }
}

/* ===== 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: absolute;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    padding: 0;
    background-color: rgba(255, 255, 255, 0.6);
    border: none;
    color: black;
    font-size: 24px;
    cursor: pointer;
    border-radius: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
top: 50%;
transform: translateY(-50%);
}

.hcg-arrow-left {
left: 5px;
}
.hcg-arrow-right {
right: 5px;
}

.hcg-arrow:hover {
    background-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.hcg-arrow:active {
    transform: translateY(-50%) 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;
    }
}

/* Search bar */
.hcg-carousel-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
}

.hcg-search-toggle {
    position: absolute;
    top: 30px;
    right: 10px;
    z-index: 5;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background-color: rgba(60, 60, 60, 0.55);
    color: #fff;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.hcg-search-toggle:hover {
    background-color: rgba(60, 60, 60, 0.8);
}

.hcg-search-input {
    position: absolute;
    top: 30px;
    right: 54px;
    z-index: 5;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 18px;
    font-size: 14px;
    max-width: 200px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

@media (max-width: 767px) {
    .hcg-carousel {
        margin: 15px 0;
        gap: 0;
    }
    
    .hcg-cell {
        width: 100%;
        max-width: 100vw;
        flex-shrink: 0;
    }

    .hcg-search-toggle,
    .hcg-search-input {
        top: 25px;
    }
}
.hcg-search-toggle .material-symbols-outlined {
    font-variation-settings:
        'FILL' 1,
        'wght' 400,
        'GRAD' 0,
        'opsz' 24;
    font-size: 20px;
    color: #fff;
}

.hcg-image-zoomable {
    cursor: zoom-in;
}

.hcg-image.hcg-zoomed {
    transform: scale(2);
    cursor: zoom-out;
}

.hcg-cell:hover .hcg-image.hcg-zoomed {
    transform: scale(2);
}
.hcg-cell {
    position: relative; /* anchors .hcg-cell-actions to this cell */
}

.hcg-cell-actions {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 6;
    display: flex;
    flex-direction: column;
    gap: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.hcg-cell:hover .hcg-cell-actions {
    opacity: 1;
    pointer-events: auto;
}

.hcg-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background-color: rgba(60, 60, 60, 0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.hcg-action-btn:hover {
    background-color: rgba(60, 60, 60, 0.8);
}

.hcg-action-btn .material-symbols-outlined {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 20;
    font-size: 16px;
}

.hcg-action-btn.hcg-action-active {
    background-color: rgba(220, 60, 90, 0.85);
}

.hcg-favorites-empty {
    text-align: center;
    color: #888;
    padding: 30px 0;
}

.hcg-action-trash:hover {
    background-color: rgba(200, 50, 50, 0.85);
}
