







.container-base {
    position: relative;
    max-width: 1200px;
    margin: 0 auto 2.5rem auto;
}

.gallery-container {
    display: flex;
    gap: 2rem;
}

.gallery-main {
    width: 100%;
    margin-top: 20px;
}

.filter-sidebar {
    position: sticky;
    top: calc(var(--site-nav-offset, var(--site-nav-height, 4.75rem)) + 20px);
    left: 20px;
    width: 330px;
    background-color: var(--controls-bg);
    border: 2px solid var(--border-primary);
    padding: 1.5rem;
    height: fit-content;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 100;
    margin-left: -350px;
    transition: top 0.25s ease;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-primary);
}



.sidebar-header h3 {
    font-size: 1.5rem;
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.sidebar-header .counter-display {
    font-family: inherit !important;
    font-size: inherit !important;
    color: inherit !important;
    padding: 0 !important;
    background-color: transparent !important;
    border: none !important;
    margin: 0 !important;
    white-space: normal !important;
}

.search-section {
    padding-bottom: 1rem;
}

.filter-sidebar-actions {
    margin-top: 1.5rem;
    display: none;
}

.filter-sidebar-actions.has-active-filters {
    display: block;
}

.filter-sidebar-actions .mobile-filters-search {
    display: none;
}

.filter-reset-btn[hidden] {
    display: none;
}

.filter-reset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    height: 40px;
    padding: 0 0.75rem;
    font-size: 0.875rem;
    line-height: 1;
    flex-shrink: 0;
}

.filter-reset-btn i {
    font-size: 1.125rem;
    line-height: 1;
}

.filter-section {
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.filter-icon-container {
    flex-shrink: 0;
    padding-top: 0.5rem;
    font-weight: bold;
}

.filter-content-wrapper {
    flex: 1;
    border: 2px solid var(--border-primary);
}

.filter-toggle {
    width: 100%;
    padding: 0.25rem 1rem;
    background-color: var(--card-bg);
    border: none;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.filter-icon {
    font-size: 1rem;
    opacity: 0.7;
    color: var(--text-color);
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.filter-icon:hover {
    opacity: 1;
}

.filter-toggle.collapsed .toggle-icon {
    transform: rotate(0deg);
}

.filter-toggle .toggle-icon {
    transform: rotate(-180deg);
    font-size: 1.1rem;
    transition: transform 0.2s ease;
}

.filter-content {
    background-color: var(--card-bg);
    display: none;
}

.filter-content.expanded {
    display: block;
}

.filter-options {
    display: flex;
    flex-direction: column;
    user-select: none;
    -webkit-user-select: none;
}

.filter-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 0.25rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
}

.filter-option:hover {
    border-color: var(--border-primary);
}

.filter-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.filter-option span {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-color);
    font-weight: 500;
    margin: 0 0.5rem;
}

.filter-option input[type="checkbox"]:checked ~ span {
    font-weight: 700;
    color: var(--card-bg);
}

.filter-option input[type="checkbox"]:checked ~ .checkmark {
    display: block;
}

.filter-option:has(input[type="checkbox"]:checked) {
    background-color: var(--text-color);
    color: var(--card-bg);
}

.checkmark {
    display: none;
    color: var(--card-bg);
    font-size: 1rem;
}

.search-container {
    position: relative;
    width: 100%;
}

#searchInput {
    width: 100%;
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 0.75rem 2.5rem 0.75rem 0.75rem;
    border: 2px solid var(--border-primary);
    background-color: var(--card-bg);
    color: var(--text-color);
}

.search-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: var(--text-color);
    opacity: 0.7;
    pointer-events: none;
}





.btn-base {
    font-family: var(--font-heading);
    border: 2px solid var(--border-primary);
    background-color: var(--card-bg);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-btn {
    font-size: 1.2rem;
    letter-spacing: 1px;
    padding: 0.5rem 1rem;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 0 auto 2.5rem auto;
    gap: 2.5rem;
    width: 100%;
}

.gallery-item {
    background-color: var(--card-bg);
    border: 2px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.gallery-item .bottom-flap {
    content: '';
    position: absolute;
    transform: perspective(300px) rotateX(0deg);
    transform-origin: top;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0;
    background-color: var(--card-bg);
    margin-bottom: -1px;
}

.gallery-item .top-flap {
    content: '';
    position: absolute;
    transform: perspective(300px) rotateX(0deg);
    transform-origin: bottom;
    top: 0;
    left: 0;
    right: 0;
    height: 0;
    background-color: var(--card-bg);
    margin-top: -1px;
}

.gallery-item:hover .bottom-flap {
    transform: perspective(300px) rotateX(-60deg);
    border: 2px solid var(--border-primary);
    transition: all 0.3s ease;
    transform-origin: top;
    bottom: -60px;
    height: 60px;
    z-index: -1;
}

.gallery-item:hover .top-flap {
    transform: perspective(300px) rotateX(60deg);
    border: 2px solid var(--border-primary);
    transition: all 0.3s ease;
    transform-origin: bottom;
    top: -60px;
    height: 60px;
    z-index: -1;
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-item .image-container {
    position: relative;
    width: 100%;
    height: 220px;
}

.gallery-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.gallery-item-info {
    padding: 1rem 0;
    border-top: 2px solid var(--border-primary);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.gallery-item-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    line-height: 1.1;
    text-align: center;
    margin-bottom: 1rem;
    text-transform: uppercase;
    color: var(--text-color);
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.gallery-item-details {
    display: flex;
    justify-content: space-around;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 700;
    border-top: 2px solid #eee;
    padding-top: 0.75rem;
    margin-top: auto;
}

.gallery-item-details span {
    color: #888;
    display: block;
    font-size: 0.75rem;
}

.brand-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1.5rem;
    color: white;
    font-weight: 900;
    text-transform: uppercase;
    font-family: var(--font-body);
    letter-spacing: 0.5px;
    border-top: 2px solid var(--border-primary);
}

/* Loading */
.loading {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    text-align: center;
    padding: 20px;
    background: color-mix(in srgb, var(--bg-color) 92%, transparent);
    color: var(--text-color);
}

.loading.is-active {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.08);
    border-top-color: var(--text-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

.loading p {
    margin: 0;
    font-weight: 600;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-color);
    font-size: 1.5rem;
    font-weight: bold;
}





/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 26, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1200;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.lightbox-content {
    position: relative;
    width: calc(100% - 4rem);
    height: calc(100% - 4rem);
    background: var(--card-bg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.lightbox-btn {
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--text-color);
    cursor: pointer;
    transition: background 0.3s;
    font-family: var(--font-body);
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 20px;
    width: 40px;
    height: 40px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.lightbox-close i {
    font-size: 1.5rem;
    line-height: 1;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    z-index: 10;
}

.lightbox-info .lightbox-prev {
    left: 20px;
    bottom: 0;
    top: auto;
}

.lightbox-info .lightbox-next {
    left: 80px;
    bottom: 0;
    top: auto;
}

.lightbox-image-container {
    overflow: hidden;
    flex: 1;
    min-height: 0;
    background-color: var(--bg-color);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateZ(0);
    cursor: grab;
    pointer-events: auto;
}

.lightbox-image-container img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    cursor: grab;
    user-select: none;
    will-change: transform;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
    transition: transform 0.3s ease;
    pointer-events: auto;
}

.lightbox-image-container img:active {
    cursor: grabbing;
}

.lightbox-zoom-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 50;
    pointer-events: auto;
}

.lightbox-view-controls {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 50;
    pointer-events: auto;
}

.view-btn-lightbox {
    font-size: 0.9rem;
    padding: 8px 12px;
    font-weight: 500;
    pointer-events: auto;
    touch-action: manipulation;
}

.zoom-btn {
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    touch-action: manipulation;
}

.lightbox-info {
    padding: 20px;
    background: var(--card-bg);
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    border-top: 2px solid var(--border-primary);
    box-sizing: content-box;
}

.lightbox-info-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.lightbox-info-side {
    position: absolute;
    right: 20px;
    bottom: 20px;
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
}

.lightbox-random-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    overflow: hidden;
}

.lightbox-random-btn i {
    display: inline-block;
    font-size: 1.25rem;
    line-height: 1;
}

.lightbox-random-btn i.is-jumping {
    animation: dice-rotate 0.25s cubic-bezier(0.6, 0.1, 0.4, 1);
}

@keyframes dice-rotate {
    0% { transform: rotate(0deg); }
    30% { transform: rotate(-40deg); }
    60% { transform: rotate(20deg); }
    80% { transform: rotate(-10deg); }
    100% { transform: rotate(0deg); }
}

.lightbox-info-meta {
    text-align: right;
    position: static;
    border: 1px dashed var(--border-secondary);
    padding: 6px 14px 6px 14px;
    font-family: var(--font-mono);
}

.lightbox-info-meta p {
    margin: 0 0 -4px 0;
}

.lightbox-info h3 {
    font-family: var(--font-heading);
    color: var(--text-color);
    margin-bottom: 0;
    font-size: 3rem;
    text-align: center;
    width: 100%;
}

.lightbox-info p {
    color: var(--text-color);
    line-height: 1.6;
}

.lightbox-item-details {
    display: flex;
    justify-content: center;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 700;
}

.lightbox-item-details div {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid var(--border-primary);
    padding: 8px 12px;
    min-width: 80px;
}

.lightbox-item-details div span {
    color: #888;
    display: block;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.scan-credit {
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.7;
    margin-top: 0.5rem;
    font-style: italic;
}

.image-meta {
    font-size: 0.85rem;
    color: var(--text-color);
    opacity: 0.6;
    margin: 0;
}


@media (max-width: 1900px) {
    .gallery-container {
        max-width: 100vw;
        gap: 1.5rem;
        padding-left: 370px;
        margin-right: 1.5rem;
    }

    .gallery-main {
        width: 100% !important;
        transform-origin: top left;
    }

    .gallery-main .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
        justify-content: start;
        width: 100%;
    }
    
    .gallery-main .gallery-item {
        width: 100%;
        min-width: 250px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    

    
    .gallery-container {
        flex-direction: column;
        max-width: 100%;
        gap: 1rem;
        padding: 1rem;
        margin: 0;
        padding-left: 1rem;
    }

    #mobileFiltersPanel .filter-sidebar {
        position: static;
        width: 100%;
        left: auto;
        top: auto;
        margin: 0;
        max-height: none;
        overflow-y: visible;
        background-color: transparent;
        border: 0;
        padding: 0;
    }

    #mobileFiltersPanel .filter-sidebar .sidebar-header:first-child {
        display: none;
    }

    .gallery-container > .filter-sidebar {
        display: none;
    }

    .gallery-main {
        width: 100% !important;
        margin: 0;
        max-width: 100%;
        padding: 0;
    }

    .search-section {
        margin-bottom: 1rem;
    }

    .search-container {
        width: 100%;
    }

    body.mobile-filters-open .search-icon {
        display: none;
    }

    body.mobile-filters-open #mobileFiltersPanel .search-container input {
        padding-right: 0.75rem;
    }

    #mobileFiltersPanel .filter-sidebar-actions {
        display: flex;
        gap: 0.75rem;
        align-items: stretch;
        margin-top: 1.5rem;
    }

    #mobileFiltersPanel .filter-sidebar-actions .filter-reset-btn {
        height: auto;
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }

    #mobileFiltersPanel .filter-sidebar-actions .mobile-filters-search {
        display: inline-flex;
        flex: 1;
        justify-content: center;
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }

    #searchInput {
        width: 100%;
        min-width: auto;
    }

    .filter-section {
        margin-bottom: 1rem;
        position: relative;
        display: flex;
        align-items: flex-start;
    }

    .filter-toggle {
        width: 100%;
        justify-content: space-between;
    }

    .filter-content {
        position: relative;
    }
    
    .filter-content-wrapper {
        flex: 1;
        position: relative;
    }

    .filter-content.expanded {
        display: block !important;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 100;
        background-color: var(--card-bg);
        border: 2px solid var(--border-primary);
        border-top: none;
        max-height: 400px;
        overflow-y: auto;
        width: 100%;
        max-width: 100%;
    }

    .gallery-main .gallery-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem;
        justify-content: start;
        width: 100%;
        margin: 0;
    }



    /* Hide flaps completely on mobile */
    .gallery-item .bottom-flap,
    .gallery-item .top-flap {
        display: none !important;
    }

    .gallery-page {
        --site-nav-height: 5.5rem;
    }

    .scroll-to-top {
        right: max(12px, env(safe-area-inset-right));
        bottom: max(12px, env(safe-area-inset-bottom));
    }

    .lightbox-zoom-controls {
        bottom: 10px;
        right: 10px;
        left: auto;
        transform: none;
        gap: 5px;
        z-index: 30;
    }

    .zoom-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
        pointer-events: auto;
        touch-action: manipulation;
    }

    .lightbox-view-controls {
        bottom: 10px;
        left: 10px;
        top: auto;
        right: auto;
        gap: 3px;
        z-index: 30;
    }

    .view-btn-lightbox {
        font-size: 0.8rem;
        padding: 6px 10px;
        pointer-events: auto;
        touch-action: manipulation;
    }
    
    .lightbox-info {
        flex-direction: column;
        gap: 10px;
        justify-content: center;
        align-items: center;
        padding-bottom: 90px;
    }
    
    .lightbox-info-main {
        align-items: center;
        width: 100%;
    }
    
    .lightbox-info-meta {
        display: none !important;
    }

    .lightbox-info-side {
        right: 70px;
        bottom: 25px;
    }
    
    .lightbox-info-toggle {
        position: absolute;
        bottom: 25px;
        right: 20px;
        display: block !important;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .lightbox-info-meta.show {
        display: block !important;
        position: static !important;
        text-align: center;
        margin-top: 10px;
        border: 1px dashed var(--border-secondary);
        padding: 12px;
        font-family: var(--font-mono);
    }
    
    .lightbox-content {
        width: 100%;
        height: 100%;
    }

}

@media (prefers-reduced-motion: reduce) {
    .spinner {
        animation: none;
    }

    .lightbox-random-btn i.is-jumping {
        animation: none;
    }
}
