/* assets/gallery.css - Fixed Visibility Logic */
.gallery-header { 
    padding: 160px 5% 40px; 
    text-align: center; 
}

.gallery-header h1 { 
    font-size: var(--fs-hero); 
    margin-bottom: 20px; 
}

/* --- TOOLBAR ICONS --- */
.gallery-toolbar {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.tool-btn {
    width: 50px; height: 50px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-panel);
    color: var(--text-main);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: 0.3s;
    font-size: 1.2rem;
}

.tool-btn:hover, .tool-btn.active {
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(147, 51, 234, 0.2);
    border-color: var(--primary);
}

/* --- VISIBILITY LOGIC --- */
/* Strictly hide by default */
.search-wrapper, .advanced-filters {
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: 0.4s ease;
}

/* Show state */
.search-wrapper.visible, .advanced-filters.visible {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

/* Search Bar Styling */
.search-wrapper {
    justify-content: center;
    margin-bottom: 20px;
    width: 100%;
}

#gallerySearch {
    padding: 12px 25px;
    width: 100%;
    max-width: 500px;
    border-radius: 50px;
    border: 1px solid var(--border);
    background: var(--bg-panel);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    outline: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

#gallerySearch:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(147, 51, 234, 0.1);
}

/* ADVANCED FILTERS CONTAINER */
.advanced-filters {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px;
    margin: 20px auto 40px;
    max-width: 800px;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.filter-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
    min-width: 200px;
}

.filter-group label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.filter-group select, 
.filter-group input[type="range"] {
    width: 100%;
    padding: 8px;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.filter-btn {
    padding: 8px 20px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-body);
    color: var(--text-main);
    cursor: pointer;
    font-size: 0.85rem;
    transition: 0.2s;
}

.filter-btn.active, .filter-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .gallery-header { padding: 140px 5% 40px; }
    .advanced-filters { padding: 15px; }
    .filter-row { flex-direction: column; gap: 15px; }
    .filter-group { min-width: 100%; }
    #gallerySearch { font-size: 16px; padding: 15px 20px; }
}

/* compact action buttons for mobile */
@media (max-width: 768px) {
    .modal-actions {
        display: flex;
        flex-wrap: wrap; /* allows hold button to stay full width if needed */
        justify-content: center;
        gap: 12px;
    }

    /* make the icon buttons smaller and circular */
    .modal-actions .luxury-btn:not(.dark-btn) {
        width: 50px;
        height: 50px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
    }

    /* keep the 'Hold Art' button prominent */
    .modal-actions .dark-btn {
        width: 100%; /* full width on mobile for better accessibility */
        order: -1;   /* pushes it to the top of the action group */
    }
}