/* aieo/brand-azindex — A-Z directory styles. */

:root {
    --aieo-az-pink: #F46767;
    --aieo-az-pink-soft: #fcf0f1;
    --aieo-az-text: #1f2937;
    --aieo-az-muted: #9ca3af;
    --aieo-az-border: #e5e7eb;
    --aieo-az-bg: #ffffff;
}

/* Brand-shopping page hero — same gradient palette as brand-archive-hero
   so the two pages feel like the same family. Lives here because every
   brand-shopping page renders this block. */
.aieo-brand-shopping-hero {
    background: linear-gradient(135deg, #fcf0f1 0%, #ffe9eb 50%, #fff 100%);
}
.aieo-brand-shopping-hero__title    { margin: 0; }
.aieo-brand-shopping-hero__subtitle {
    margin: 0 auto;
    max-width: 720px;
}

.aieo-brand-azindex {
    color: var(--aieo-az-text);
    font: inherit;
}

/* ── A-Z bar ─────────────────────────────────────────────────────── */

.aieo-azbar {
    background: var(--aieo-az-bg);
    border-bottom: 1px solid var(--aieo-az-border);
    padding: 12px 0;
    margin: 0 0 12px;
    z-index: 50;
}

.aieo-azbar--sticky {
    position: sticky;
    /* --aieo-az-top is published by view.js = WP admin bar height + the global
     * sticky header height (`header.wp-block-template-part`), measured live so
     * the bar GLUES directly under the sticky menu on BOTH desktop & mobile
     * (header height differs per breakpoint) and re-measures on resize. The 0px
     * fallback applies only for the split-second before the script runs. */
    top: var(--aieo-az-top, 0px);
}

.aieo-azbar__list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 4px;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    justify-content: center;
}

.aieo-azbar__chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 6px;
    color: var(--aieo-az-text);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    line-height: 1;
    transition: background-color 120ms ease, color 120ms ease, transform 120ms ease;
}

.aieo-azbar__chip:hover {
    background: var(--aieo-az-pink-soft);
    color: var(--aieo-az-pink);
}

.aieo-azbar__chip.is-active {
    background: var(--aieo-az-pink);
    color: #fff;
}

.aieo-azbar__chip.is-empty,
.aieo-azbar__chip[data-empty="1"] {
    color: var(--aieo-az-muted);
    opacity: 0.5;
    pointer-events: none;
    cursor: default;
}

.aieo-azbar__active-meta {
    display: inline-block;
    margin-left: 12px;
    font-size: 13px;
    color: var(--aieo-az-pink);
    font-weight: 600;
    min-width: 60px;
}

/* Mobile: horizontally scrollable strip with snap, single row. */
@media (max-width: 768px) {
    .aieo-azbar__list {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        justify-content: flex-start;
        padding: 0 8px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    .aieo-azbar__list::-webkit-scrollbar { height: 0; display: none; }
    .aieo-azbar__item { scroll-snap-align: center; }
    .aieo-azbar__chip { min-width: 36px; height: 36px; font-size: 16px; }
    .aieo-azbar__active-meta {
        display: block;
        margin: 6px 0 0;
        text-align: center;
    }
}

/* ── Letter sections ─────────────────────────────────────────────── */

.aieo-letter {
    margin: 24px 0;
    scroll-margin-top: 80px;
}

.aieo-letter.is-empty {
    height: 0;
    margin: 0;
    overflow: hidden;
}

.aieo-letter__heading {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 0 0 12px;
    font-weight: 700;
    border-bottom: 1px solid var(--aieo-az-border);
    padding-bottom: 6px;
}

.aieo-letter__glyph {
    color: var(--aieo-az-pink);
    font-size: 1.4em;
}

.aieo-letter__count {
    font-size: 13px;
    font-weight: 500;
    color: var(--aieo-az-muted);
}

.aieo-letter__grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.aieo-brand-card {
    border: 1px solid var(--aieo-az-border);
    border-radius: 8px;
    background: #fff;
    transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}
.aieo-brand-card:hover {
    border-color: var(--aieo-az-pink);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(244, 103, 103, 0.08);
}
.aieo-brand-card.is-promo {
    border-color: var(--aieo-az-pink);
}
.aieo-brand-card.is-promo::before {
    content: "★";
    position: absolute;
    color: var(--aieo-az-pink);
    margin: 6px 0 0 6px;
    font-size: 12px;
}
.aieo-brand-card__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    color: inherit;
    text-decoration: none;
    min-height: 60px;
}
.aieo-brand-card__logo {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    border-radius: 6px;
    overflow: hidden;
}
.aieo-brand-card__logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.aieo-brand-card__body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.aieo-brand-card__name {
    font-weight: 600;
    font-size: 15px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}
.aieo-brand-card__meta {
    font-size: 12px;
    color: var(--aieo-az-muted);
}
