/* ===== قسم "أفضل العلامات التجارية" بالصفحة الرئيسية ===== */
.brands-section {
    padding: 36px 0;
}

.brands-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.brands-section__title {
    position: relative;
    margin: 0;
    padding-inline-start: 14px;
    font-size: 20px;
    font-weight: 800;
    color: #670756;
}

.brands-section__title::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 20px;
    border-radius: 999px;
    background: linear-gradient(180deg, #670756, #b65aa0);
}

.brands-section__view-all {
    font-size: 13.5px;
    font-weight: 700;
    color: #670756;
    text-decoration: none;
    white-space: nowrap;
}

.brands-section__view-all:hover {
    text-decoration: underline;
}

/* سطر واحد فقط بالرئيسية - أي براندات زيادة تُخفى تمامًا (بلا التفاف أو تمرير) بما أن
   زر "عرض الكل" هو المكان المخصص لرؤية الباقي. */
.brands-section__row {
    display: flex;
    flex-wrap: nowrap;
    overflow: hidden;
    justify-content: center;
    gap: 14px;
}

.brands-section__card {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 150px;
    max-width: 180px;
    height: 84px;
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(17, 24, 39, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.brands-section__card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(103, 7, 86, 0.12);
    border-color: #e9d9e4;
}

.brands-section__logo {
    max-width: 70%;
    max-height: 38px;
    object-fit: contain;
    /* filter: grayscale(1);
    opacity: 0.65; */
    transition: filter 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}

.brands-section__card:hover .brands-section__logo {
    filter: grayscale(0);
    opacity: 1;
    transform: scale(1.06);
}

/* ===== صفحة "كل العلامات التجارية" المستقلة - بطاقات أكبر مع اسم البراند ظاهر ===== */
.brand-directory__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 18px;
}

.brand-directory__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 22px 14px;
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(17, 24, 39, 0.04);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.brand-directory__card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 28px rgba(103, 7, 86, 0.14);
    border-color: #e9d9e4;
    text-decoration: none;
}

.brand-directory__logo-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
}

.brand-directory__logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* بديل أنيق بالحرف الأول، يظهر فقط لو فشل تحميل الصورة الفعلية (onerror بالـ HTML) */
.brand-directory__fallback {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #670756, #b65aa0);
    color: #fff;
    font-size: 22px;
    font-weight: 800;
}

.brand-directory__name {
    font-size: 13.5px;
    font-weight: 700;
    color: #1f2937;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

@media (max-width: 767px) {
    .brand-directory__grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 12px;
    }

    .brand-directory__card {
        padding: 16px 10px;
    }

    .brand-directory__logo-wrap {
        width: 50px;
        height: 50px;
    }

    .brand-directory__fallback {
        font-size: 18px;
    }
}

@media (max-width: 767px) {
    .brands-section {
        padding: 24px 0;
    }

    .brands-section__title {
        font-size: 17px;
    }

    .brands-section__row {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 6px;
        scrollbar-width: none;
    }

    .brands-section__row::-webkit-scrollbar {
        display: none;
    }

    .brands-section__card {
        flex: 0 0 130px;
        height: 72px;
    }

    .brands-section__logo {
        max-height: 30px;
    }
}
