/* ==========================================================================
   Brands page (markup: storefront/brands.blade.php, behaviour: js/storefront/brands-page.js)
   ========================================================================== */

.brands-page {
    padding: 0 var(--page-gutter);
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.brands-page__head {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brands-page__subtitle {
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 800;
}

/* ---------- Popular: 4 round tiles per row ---------- */

.brands-popular__grid {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px 10px;
}

.brand-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.brand-tile__initial {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, #F4EDFF 0%, #FFE6F0 100%);
    border: 1px solid var(--color-border-strong);
    color: var(--color-offer);
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-tile__name {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;    overflow-wrap: break-word;
}

/* ---------- A to Z ---------- */

.brands-all__filter {
    width: 100%;
    height: 44px;
    margin-bottom: 8px;
    padding: 0 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-strong);
    background: var(--color-surface);
    font-size: 16px;
}

.brands-all__filter:focus {
    border-color: var(--color-primary);
    outline: none;
}

.brands-letter[hidden] {
    display: none;
}

.brands-letter__title {
    margin: 10px 0 6px;
    padding: 4px 12px;
    border-radius: 10px;
    background: var(--letter-band, #2A1052);
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 800;
    color: #FFFFFF;
}

.brands-letter__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.brands-letter__list li[hidden] {
    display: none;
}

.brand-row {
    min-height: 48px;
    padding: 0 4px;
    border-bottom: 1px solid #F1ECF7;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-row__name {
    flex: 1 1 auto;
    font-size: 15px;
    font-weight: 600;
}

.brand-row__count {
    font-size: 13px;
    color: var(--color-text-muted);
}

.brand-row .icon {
    width: 16px;
    height: 16px;
    color: var(--color-text-muted);
}

@media (min-width: 768px) {
    .brands-popular__grid {
        grid-template-columns: repeat(8, minmax(0, 1fr));
    }
}

/* ---------- Product photos and the A–Z bar ----------
   Photo box #F3EEFA · letter #6B21A8 · bar #FFFFFF with border #E4DAF2, letters #6B21A8 */

.brand-tile__photo {
    object-fit: contain;
    background: #FFFFFF;
}

.brand-row__photo {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #F3EEFA;
    object-fit: contain;
}

.brand-row__photo--letter {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6B21A8;
    font-size: 18px;
    font-weight: 800;
}

/* Room on the right for the bar */
.brands-all {
    padding-right: 30px;
}

.brands-bar {
    position: fixed;
    right: 4px;
    top: 50%;
    z-index: 20;
    transform: translateY(-50%);
    max-height: 70vh;
    padding: 4px 0;
    border: 1px solid #E4DAF2;
    border-radius: 999px;
    background: #FFFFFF;
    display: flex;
    flex-direction: column;
    touch-action: none;
}

.brands-bar__letter {
    flex: 1 1 auto;
    min-height: 14px;
    max-height: 28px;
    width: 28px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #6B21A8;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}
