* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #fafafa;
    color: #333;
    line-height: 1.6;
}

.container-fluid {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

.brandWrappe {
    display: flex;
    flex-direction: row-reverse;
}

/* Alphabet Navigation */
.alphabet-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 60px;
    flex-wrap: wrap;
    flex-direction: column;
    margin-left: 10px;
}

/* .alphabet-nav .letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 20px;
    font-weight: 600;
    color: #666;
    background-color: transparent;
    border: 1px solid #E7E7E7;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 100%;
    letter-spacing: 0%;

}

.alphabet-nav .letter:hover {
    background-color: #f0f0f0;
    color: #333;
}

.alphabet-nav .letter.active {
    background-color: #000;
    color: #fff;
} */


.alphabet-nav .letter {
        width: 17px;
        height: 17px;
        font-size: 18px;
        background-color: unset;
        border: unset;
        color: #00000080;
    }

    .alphabet-nav .letter.active {
        background-color: unset;
        color: #000;
    }

    .alphabet-nav {
        margin-bottom: 0;
    }

    .alphabet-nav {
        overflow-y: scroll;
        scrollbar-width: none;
        -ms-overflow-style: none;
        overflow-x: hidden;
        overscroll-behavior: contain;
    }

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

/* Brand Grid */
.brand-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
    width: 100%;
    text-align: center;
}

.brand-card {
    border-radius: 10px;
    /* padding: 60px 40px; */
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background-color: #FFFAF4;
    max-height: 300px;
}

.brand-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #e0e0e0;
}

.brand-logo {

    height: 100%;
    object-fit: cover;
    object-position: center;
}

.brand-card:hover .brand-logo {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.05);
}

/* Placeholder for loading */
.brand-card.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.brand-card.error {
    background-color: #f8f8f8;
    color: #999;
    font-size: 14px;
    text-align: center;
}

/* Image loading states */
.brand-logo.loading {
    opacity: 0;
}

.brand-logo.loaded {
    opacity: 1;
    animation: fadeIn 0.3s ease-in-out;
}

.brand-logo.error {
    display: none;
}

/* Fallback text styling */
.brand-fallback {
    font-size: 18px;
    font-weight: 600;
    color: #666;
    text-align: center;
}


/* Animations */
.fade-in {
    animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.brand-fallback {
    display: none;
}

/* No results message */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 16px;
}

/* Brand count indicator */
.brand-count {
    text-align: center;
    margin-bottom: 30px;
    color: #666;
    font-size: 14px;
}


.alphabet-slider-container {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.alphabet-slider {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 8px;
}

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

.letter {
    min-width: 40px;
    padding: 8px 12px;
    border: none;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
}

.letter.active {
    background-color: #000;
    color: #fff;
}

.slider-arrow {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0 10px;
}

.alphabet-slider-container {
    display: none;
}

.hide-for-desktop {
    display: none;
}

.brands-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    align-items: flex-start;
}
.heart-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

@media screen and (max-width: 768px) {
    .main-content {
        display: flex;
        flex-direction: row-reverse;
        gap: 5px;
    }

    .hide-for-desktop {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .alphabet-slider-container {
        display: none;
    }


    .brand-card {
        padding: 30px 20px;
        min-height: 140px;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .container-fluid {
        padding: 20px 15px;
    }

    .brand-grid {
        width: 100%;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        max-width: 100%;
        max-height: calc(100vh - 180px);
        overflow-y: auto;
    }

    .brand-card {
        padding: 10px 10px;
        min-height: unset;
        width: 100%;
        aspect-ratio: 1/1;
    }

    .alphabet-nav {
        gap: 4px;
        /* margin-bottom: 40px; */
        flex-direction: column;
        max-height: calc(100dvh - 195px);
        overflow: auto;
        flex-wrap: nowrap;
        justify-content: unset;
        background: #fafafa;
        right: 0px;
    }

    .alphabet-nav .letter {
        width: 17px;
        height: 17px;
        font-size: 13px;
        background-color: unset;
        border: unset;
        color: #00000080;
    }

    .alphabet-nav .letter.active {
        background-color: unset;
        color: #000;
    }

    .alphabet-nav {
        margin-bottom: 0;
    }

    .alphabet-nav {
        overflow-y: scroll;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

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

    .brand-fallback {
        display: block;
        font-size: 14px;
        line-height: 14px;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
        width: 100%;
    }

    .back-to-top-btn svg {
        transform: rotate(90deg);
        width: 20px;
        height: 20px;
    }

    .back-to-top-btn {
        display: none;
        width: fit-content;
        padding: 4px 20px;
        border-radius: 6px;
        border: unset;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
        background-color: black;
        color: #fff;
        position: fixed;
        top: 25%;
        z-index: 5;
    }


    .brand-card {
        width: 100%;
        max-width: 140px;
        background: #fff;
        border-radius: 12px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
        text-align: center;
        padding: 12px;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        cursor: pointer;
        margin: 0px;
        padding: 0;
        ;
    }

    .brand-card:hover {
        transform: scale(1.03);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    }

    .brand-logo {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .brand-fallback {
        width: 70px;
        height: 70px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        font-weight: 600;
        color: #444;
        background: #f2f2f2;
        border-radius: 50%;
        margin: 0 auto;
    }

    .brand-name {
        font-size: 14px;
        margin-top: 6px;
        font-weight: 600;
        color: #222;
    }
   

    @media (min-width: 768px) {
        .brand-card {
            display: none;
        }
    }

}

[lang="ar"] {
    .main-content {
        direction: ltr !important;
    }
}