/* ============================================================
   CarShine – Galerie / Before-After Slider (galerie.css)
   ============================================================ */

/* Description */
.gallery-description {
    text-align: center;
    margin: 2rem auto;
    max-width: 800px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Filter Tabs */
.gallery-filter {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin: 2rem 0 3rem;
    flex-wrap: wrap;
}

.gallery-filter-btn {
    padding: 0.6rem 1.8rem;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.03em;
}

.gallery-filter-btn:hover {
    background: rgba(255, 107, 0, 0.12);
    border-color: rgba(255, 107, 0, 0.5);
    color: var(--text-primary);
}

.gallery-filter-btn.active {
    background: rgba(255, 107, 0, 0.18);
    border-color: var(--accent-color);
    color: var(--accent-color);
    box-shadow: 0 0 14px rgba(255, 107, 0, 0.2);
    font-weight: 600;
}

/* Gallery Grid */
.ba-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 3rem;
}

/* Card */
.ba-card {
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s ease,
                border-color 0.3s ease;
}

.ba-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.ba-card:hover {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
    border-color: rgba(255, 255, 255, 0.2);
}

.ba-card.hidden {
    display: none;
}

/* Slider area */
.ba-slider {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    cursor: col-resize;
    user-select: none;
    touch-action: pan-y;
}

.ba-before,
.ba-after {
    position: absolute;
    inset: 0;
}

.ba-before img,
.ba-after img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    transition: transform 0.4s ease;
}

.ba-card:hover .ba-before img,
.ba-card:hover .ba-after img {
    transform: scale(1.04);
}

/* After image revealed from the right */
.ba-after {
    clip-path: inset(0 0 0 50%);
}

/* Divider line */
.ba-divider {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 14px rgba(0, 0, 0, 0.7);
    pointer-events: none;
    z-index: 10;
}

/* Drag handle */
.ba-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 4px 22px rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 11;
    pointer-events: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ba-slider:active .ba-handle,
.ba-slider.dragging .ba-handle {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.65);
}

.ba-handle svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: #333;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Labels */
.ba-label {
    position: absolute;
    top: 0.9rem;
    padding: 0.28rem 0.7rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    z-index: 5;
    pointer-events: none;
    backdrop-filter: blur(8px);
    transition: opacity 0.25s ease;
}

.ba-label-before {
    left: 0.9rem;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
}

.ba-label-after {
    right: 0.9rem;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
}

/* Card footer */
.ba-card-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 1.2rem;
    background: rgba(20, 20, 20, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ba-card-footer::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-color, #ff6b00);
    flex-shrink: 0;
}

.ba-card-title {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.02em;
}

/* Responsive */
@media (max-width: 768px) {
    .ba-gallery {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
        padding: 0 15px 2rem;
    }
}

@media (max-width: 480px) {
    .ba-gallery {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .gallery-filter-btn {
        padding: 0.5rem 1.2rem;
        font-size: 0.85rem;
    }
}
