/* =================================================================
   Al Mostafa — Brands Module
   ================================================================= */

/* ---------------------------------------------------------------
 * 1. Custom Properties (Design Tokens)
 * ------------------------------------------------------------- */
:root {
    --am-primary: #E63C14;
    --am-primary-dk: #c22e0d;
    --am-black: #000000;
    --am-gray: #464646;
    --am-bg: #F8F7F4;
    --am-border: #E6E1DA;
    --am-white: #ffffff;
    --am-radius: 5px;
    --am-radius-sm: 3px;
    --am-shadow: 0 4px 24px rgba(0, 0, 0, .06);
    --am-shadow-lg: 0 12px 48px rgba(0, 0, 0, .12);
    --am-transition: .25s cubic-bezier(.4, 0, .2, 1);
    --am-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---------------------------------------------------------------
 * 2. Wrapper
 * ------------------------------------------------------------- */
.almostafa-brands {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: var(--am-font);
    color: var(--am-black);
}

/* ---------------------------------------------------------------
 * 3. Filter Bar
 * ------------------------------------------------------------- */
.brands-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 36px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--am-border);
}

.brands-filter__btn {
    border: 1px solid var(--am-border);
    background: var(--am-white);
    color: var(--am-gray);
    font-family: var(--am-font);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 20px;
    border-radius: 3px;
    cursor: pointer;
    transition: all var(--am-transition);
    line-height: 1.4;
}

.brands-filter__btn:hover {
    border-color: var(--am-primary);
    color: var(--am-primary);
}

.brands-filter__btn.is-active {
    background: var(--am-primary);
    border-color: var(--am-primary);
    color: var(--am-white);
}

.brands-filter__count {
    font-size: 13px;
    color: var(--am-gray);
    margin-left: auto;
}

/* ---------------------------------------------------------------
 * 4. Brands Grid
 * ------------------------------------------------------------- */
.brands-grid {
    display: grid;
    gap: 28px;
    grid-template-columns: 1fr;
}

.brands-grid__empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: var(--am-gray);
    font-size: 16px;
}

/* ---------------------------------------------------------------
 * 5. Brand Card (centered vertical layout)
 * ------------------------------------------------------------- */
.brand-card {
    background: var(--am-white);
    border: 1px solid var(--am-border);
    border-radius: var(--am-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 24px 28px;
    gap: 14px;
    box-shadow: var(--am-shadow);
    transition: transform var(--am-transition), box-shadow var(--am-transition);
}

.brand-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--am-shadow-lg);
}

.brand-card.is-hidden {
    display: none;
}

/* ---- 1. Logo ---- */
.brand-card__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100px;
}

.brand-card__logo img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 5px;
}

.brand-card__logo-text {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: var(--am-white);
    background: var(--am-primary);
    border-radius: 50%;
}

/* ---- 2. Brand Name ---- */
.brand-card__name {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: var(--am-black);
    line-height: 1.3;
}

/* ---- 3. Badges Row (Country + Category) ---- */
.brand-card__badges {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.brand-card__badge {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 4px 12px;
    border-radius: 3px;
    white-space: nowrap;
    background: rgba(70, 70, 70, .08);
    color: var(--am-gray);
}

/* Country badge */
.brand-card__badge--country {
    background: rgba(70, 70, 70, .06);
    color: var(--am-gray);
}

/* Category-specific badge colours */
.brand-card__badge--distribution {
    background: rgba(230, 60, 20, .10);
    color: var(--am-primary);
}

.brand-card__badge--imports {
    background: rgba(29, 78, 216, .10);
    color: #1d4ed8;
}

.brand-card__badge--manufacturing {
    background: rgba(22, 163, 74, .10);
    color: #16a34a;
}

/* ---- 4. Tagline ---- */
.brand-card__tagline {
    font-size: 14px;
    color: var(--am-gray);
    line-height: 1.55;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- 5. Footer ---- */
.brand-card__footer {
    width: 100%;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--am-border);
}

/* Row 1 — Availability */
.brand-card__available {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    color: var(--am-gray);
    opacity: .7;
}

.brand-card__available-dot {
    color: #16a34a;
    font-size: 8px;
    line-height: 1;
}

/* Row 2 — Two CTA buttons */
.brand-card__actions {
    display: flex;
    gap: 10px;
    width: 100%;
}

.brand-card__btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--am-font);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
    transition: background var(--am-transition), color var(--am-transition), transform var(--am-transition);
}

.brand-card__btn--outline {
    background: transparent;
    color: var(--am-primary);
    border: 2px solid var(--am-primary);
}

.brand-card__btn--outline:hover {
    background: var(--am-primary);
    color: var(--am-white);
    transform: scale(1.03);
}

.brand-card__btn--solid {
    background: var(--am-primary);
    color: var(--am-white);
    border: 2px solid var(--am-primary);
}

.brand-card__btn--solid:hover {
    background: #C8300E;
    border-color: #C8300E;
    color: var(--am-white);
    transform: scale(1.03);
}

/* ---------------------------------------------------------------
 * 6. Responsive
 * ------------------------------------------------------------- */

/* Tablet — 2 columns */
@media (min-width: 768px) {
    .brands-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop — 4 columns */
@media (min-width: 1200px) {
    .brands-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Mobile tweaks */
@media (max-width: 600px) {
    .almostafa-brands {
        padding: 24px 16px;
    }

    .brands-filter {
        gap: 8px;
        margin-bottom: 24px;
    }

    .brand-card {
        padding: 24px 18px 22px;
    }

    .brand-card__actions {
        flex-direction: column;
        gap: 8px;
    }
}