/* =======================================================
   BRANDS PAGE SPECIFIC
   ======================================================= */
.brand-directory-container {
    width: 100% !important; background-color: #F9F8F6 !important; position: relative !important; z-index: 10 !important;
}

.brand-directory-container .fs-secondary-nav a[href="/professionals"] {
    display: none !important;
}

 (min-width: 1025px) {
    .brand-directory-container .fs-utility-nav {
        display: none !important;
    }
}

body:not(.menu-open) .brand-directory-container {
    height: calc(100vh - 50px) ; 
    max-height: calc(100vh - 50px) ;
}

.fs-brands-content {
    flex: 1 !important; display: flex !important; flex-direction: column !important; 
    height: 100% !important; overflow: hidden !important;
}
.box-brands-filter-bar {
    display: flex; flex-wrap: wrap; gap: 15px; padding-bottom: 20px; flex-shrink: 0; align-items: center;
}

.filter-btn { background: transparent; border: none; padding: 0; font-family: inherit; font-size: 16px; letter-spacing: 0.5px; font-weight: 400; color: #000; cursor: pointer; text-transform: uppercase; }
.filter-btn.active { text-decoration: underline; font-weight: 500; }
.filter-btn.disabled { color: #CCC; pointer-events: none; }

/* The Scrollable Area */
.box-brands-list-container { flex-grow: 1; overflow-y: auto; scroll-behavior: smooth; scrollbar-width: none; }
.box-brands-list-container::-webkit-scrollbar { display: none; }

.box-brand-section { margin-bottom: 20px; }
.box-brand-letter-title { font-family: inherit; font-size: 16px; font-weight: 400; margin: 0 0 10px 0; text-transform: uppercase; color: #000; }
.box-brand-letter-title.active-letter { border-bottom: 1px solid #000; display: inline-block; }

/* Desktop Grid */
.box-brand-grid { 
    display: grid !important; 
    grid-template-columns: repeat(3, 250px) !important; /* Precise width to match design spacing */
    column-gap: 80px !important; 
    row-gap: 8px !important; 
}

.box-brand-link { text-decoration: none; color: #000; font-size: 14px; text-transform: uppercase; line-height: 1.2; display: block !important; }
.box-brand-link:hover { opacity: 0.6; }

/* =======================================================
   MOBILE OPTIMIZATIONS FOR BRANDS PAGE
   ======================================================= */
@media (max-width: 1024px) {
    
    /* Hide brands filter bar & newsletter on mobile */
    .box-brands-filter-bar, 
    .fs-newsletter { display: none !important; } 

    /* 1. Resize the Sidebar to make room for the Brands List */
    .fs-sidebar {
        flex: 0 0 150px !important; 
        max-width: 150px !important;
		
    }

    /* 2. THE FIX: Force Brands Grid to 1 Column so it stops blowing out the screen */
    .box-brand-grid {
        grid-template-columns: 1fr !important;
        column-gap: 0 !important;
    }
    
    /* 3. Guarantee the list container handles the vertical scroll properly */
    .box-brands-list-container {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        width: 100% !important;
        padding-right: 5px !important; /* Breathing room for scrolling */
    }
	body:not(.menu-open) .brand-directory-container {
    height: calc(100dvh - 65px) ; 
    max-height: calc(100dvh -65px) ;
		margin-top: 15px;
}
}
/* Brand AJAX search */
.brand-search-trigger {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    text-align: left !important;
    cursor: pointer !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

.brand-directory-container.is-brand-searching .box-brands-filter-bar,
.brand-directory-container.is-brand-searching .box-brands-list-container {
    display: none !important;
}

.box-brand-search-panel[hidden] {
    display: none !important;
}

.box-brand-search-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    gap: 20px;
}

.box-brand-search-form {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0;
    border-bottom: 1px solid #000;
}

.box-brand-search-input {
    flex: 1;
    min-width: 0;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0 0 10px !important;
    font-family: var(--e-global-typography-primary-font-family), "AeonikPro", Sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: uppercase;
    color: #000;
    appearance: none;
    -webkit-appearance: none;
}

.box-brand-search-input::placeholder {
    color: #000;
    opacity: 1;
}

.box-brand-search-close {
    position: relative;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    margin: 0 0 10px;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer;
}

.box-brand-search-close span {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: #000;
}

.box-brand-search-close span:nth-child(1) { transform: rotate(45deg); }
.box-brand-search-close span:nth-child(2) { transform: rotate(-45deg); }

.box-brand-search-results {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: none;
    display: grid;
    grid-template-columns: repeat(3, 250px);
    column-gap: 80px;
    align-content: start;
}

.box-brand-search-results::-webkit-scrollbar {
    display: none;
}

.box-brand-search-item {
    display: flex !important;
    flex-direction: column;
    gap: 4px;
    padding: 0 0 14px;
    text-decoration: none !important;
    color: #000 !important;
    text-transform: uppercase;
}

.box-brand-search-name {
    font-size: 14px;
    line-height: 1.2;
}

.box-brand-search-count,
.box-brand-search-loading {
    font-size: 11px;
    line-height: 1.2;
    color: #777;
    text-transform: uppercase;
}

.box-brand-search-loading {
    padding: 0 0 14px;
}

@media (max-width: 1024px) {
    .box-brand-search-results {
        display: flex;
        flex-direction: column;
        gap: 0;
        width: 100%;
    }
}
