/* ==========================================================================
   PISTON TRIBE: BRANDS PAGE (FINAL V19 - FREE SCROLL & LARGER)
   ========================================================================== */

/* --- 0. LAYOUT STABILITY --- */
.brand-list-wrapper {
    width: 100%;
    overflow-x: hidden; 
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* --- 1. SEARCH BOX --- */
.brand-search-box {
    margin: 0 0 30px 0;
    width: 100%;
    max-width: 100%;
}

.brand-search-box input {
    width: 100%;
    padding: 15px 20px;
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    border: 1px solid #d8d8d8; 
    background: #fff;
    color: #111;
    border-radius: 8px;
    outline: none;
    box-shadow: none;
    transition: all 0.3s ease;
}

.brand-search-box input:focus {
    border-color: #000; 
    box-shadow: none;
}


/* --- 2. ALPHABET FILTER --- */
.alphabet-filter {
    display: flex;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 8px;
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
    overflow-x: scroll;
    white-space: nowrap;
    
    /* Standard smooth scrolling */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.alphabet-filter::-webkit-scrollbar { display: none; }

.filter-letter {
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    color: #000;
    padding: 6px 12px;
    border: 1px solid transparent;
    background: transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
    display: inline-block;
}

.filter-letter.active {
    font-weight: 700;
    border-bottom: 2px solid #000;
    color: #000;
    cursor: pointer;
}

.filter-letter.inactive {
    color: #c0c0c0;
    pointer-events: none;
}

.filter-letter:hover:not(.inactive) {
    color: #555;
    border-bottom: 2px solid #555;
}

@media (max-width: 768px) {
    .alphabet-filter {
        overflow-x: scroll;
        white-space: nowrap;
        padding-bottom: 10px;
    }
    .filter-letter { display: inline-block; }
}


/* --- 3. BRAND SECTIONS --- */
.brand-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: flex-start;
    width: 100%;
}

.brand-letter {
    display: inline-block;
    font-size: 22px;
    font-weight: 800;
    text-transform: uppercase;
    color: #000;
    margin: 0;
    line-height: 1;
    padding-bottom: 5px;
    border-bottom: 2px solid #000;
}


/* --- 4. BRAND LIST SCROLLER --- */
.brand-list {
    display: flex;
    gap: 10px;
    overflow-x: auto; 
    padding: 10px 0 20px 0;
    
    /* FREE FLOW SCROLLING (No Snap) */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    
    scrollbar-width: none; 
    -ms-overflow-style: none;
    width: 100%;
}
.brand-list::-webkit-scrollbar { display: none; }


/* --- 5. BRAND CARD --- */
.brand-item {
    /* Desktop: Show 7.5 cards (Wider/Larger) */
    flex: 0 0 calc((100% - 105px) / 7.5);
    
    /* Height increased to 175px (+10%) */
    height: 175px; 
    
    position: relative;
    border-radius: 8px; 
    overflow: hidden;
    background: #fff;
    border: 1px solid #eee;
    margin: 0 !important;
    
    /* Removed scroll-snap-align */
    transition: border-color 0.3s ease;
}



.brand-link {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

/* Image Area (Strict 120px) */
.brand-image-wrapper {
    width: 100%;
    height: 120px;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #f9f9f9;
}

.brand-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

/* Text Area */
.brand-text-wrapper {
    flex: 1;
    padding: 5px 5px 0 5px;
    background: #fff;
    display: flex;
    align-items: center; 
    justify-content: center; 
}

.brand-text-wrapper {
    color: #000;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-transform: capitalize;
    text-align: center;
    line-height: 1.1;
    word-break: break-word; 
}


/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    .brand-item {
        /* Tablet: Show 5.5 cards */
        flex: 0 0 calc((100% - 75px) / 5.5);
    }
}

@media (max-width: 768px) {
    .brand-item {
        /* Mobile: Show 2.8 cards (Larger than 3.5) */
        flex: 0 0 calc((100% - 30px) / 2.8);
        height: 175px;
    }
    
    .brand-letter { font-size: 18px; border-width: 2px; }
    
    .brand-text-wrapper { font-size: 13px; } 
}