﻿
:root {
    --bg: #f7f8fb;
    --card: #ffffff;
    --text: #121417;
    --muted: #6b7280;
    --border: #e5e7eb;
    --ring: #9ad72c;
    --primary: #b7ea29;
    --primary-ink: #0f172a;
    --chip-bg: #f3f4f6;
    --chip-on: #e8f7c4;
    --chip-ink: #0f172a;
    --danger: #ef4444;
    --ok: #059669;
    --low: #ca8a04;
}

html, body {
    background: var(--bg);
    color: var(--text);
}

a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
    border-radius: 10px;
}

.pa-wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 12px 16px 32px;
}

/* Breadcrumbs */
.pa-bc {
    margin: 0 0 10px;
    color: var(--muted);
}

    .pa-bc a {
        color: #0b4aa2;
        text-decoration: none;
    }

        .pa-bc a:hover {
            text-decoration: underline;
        }

/* Hero */
.pa-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
}

.pa-hero-img {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--border);
}

.pa-hero-title {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.2;
}

.pa-hero-sub {
    margin-top: 2px;
    color: var(--muted);
}

.pa-hero-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
    color: #334155;
}

.pa-chip {
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 9999px;
    background: #fff;
    font-size: .85rem;
    font-weight: 700;
}

/* Top tools */
.pa-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 16px 0 10px;
    align-items: center;
    justify-content: space-between;
}

.pa-count {
    color: var(--muted);
}

.pa-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.pa-search {
    min-width: 280px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}

/* Alphabet */
.pa-alpha {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0;
}

    .pa-alpha a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        background: #fff;
        text-decoration: none;
        color: #0f172a;
        font-weight: 700;
    }

        .pa-alpha a[aria-disabled="true"] {
            opacity: .45;
            pointer-events: none;
        }

/* Grid + cards */
.pa-grid {
    --min: 300px;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(var(--min), 1fr));
}

.pa-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--card);
    box-shadow: 0 10px 30px rgba(16,24,40,.05);
    padding: 14px;
}

.pa-top {
    display: flex;
    gap: 12px;
}

.pa-img {
    width: 84px;
    height: 84px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f9fafb;
    object-fit: contain;
}

.pa-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pa-name {
    font-weight: 800;
    color: #0b4aa2;
    text-decoration: none;
}

    .pa-name:hover {
        text-decoration: underline;
    }

.pa-meta {
    font-size: .92rem;
    color: var(--muted);
}

.pa-bottom {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
}

.pa-price {
    font-weight: 900;
}

.pa-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #1f2937;
    background: #fff;
    color: #1f2937;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    transition: transform .06s ease, background .15s ease, border-color .15s ease;
}

    .pa-cta:hover {
        background: #1f2937;
        color: #fff;
        border-color: #1f2937;
        transform: translateY(-1px);
    }

/* Empty */
.pa-empty {
    border: 1px dashed var(--border);
    border-radius: 16px;
    padding: 28px;
    text-align: center;
    color: #64748b;
    background: #fff;
    margin-top: 12px;
}

@media (max-width: 900px) {
    .pa-grid {
        --min: 260px;
    }
}

@media (max-width: 560px) {
    .pa-grid {
        --min: 220px;
    }
}


/* ----- Layout upgrades (sidebar + sticky brand headers) ----- */
.pa-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 12px 16px 32px;
}

.pa-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 18px;
}

.pa-sidebar {
    position: sticky;
    top: 12px;
    align-self: start;
    background: var(--card, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 16px;
    padding: 12px;
}

.pa-side-title {
    margin: 0 0 8px;
    font-weight: 900;
}

.pa-side-search {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border,#e5e7eb);
    border-radius: 12px;
}

.pa-brand-list {
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
    max-height: 60vh;
    overflow: auto;
}

    .pa-brand-list li a {
        display: flex;
        justify-content: space-between;
        gap: 8px;
        align-items: center;
        text-decoration: none;
        color: #0f172a;
        border: 1px solid var(--border,#e5e7eb);
        border-radius: 10px;
        padding: 8px 10px;
        background: #fff;
    }

        .pa-brand-list li a:hover {
            filter: brightness(1.02);
        }

.pa-brand-count {
    color: var(--muted,#6b7280);
    font-weight: 700;
}

.pa-main {
    min-width: 0;
}

.pa-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--card,#fff);
    border: 1px solid var(--border,#e5e7eb);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
}

.pa-hero-img {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--border,#e5e7eb);
}

.pa-hero-title {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.2;
}

.pa-hero-sub {
    margin-top: 2px;
    color: var(--muted,#6b7280);
}

.pa-hero-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
    color: #334155;
}

.pa-chip {
    padding: 4px 10px;
    border: 1px solid var(--border,#e5e7eb);
    border-radius: 9999px;
    background: #fff;
    font-size: .85rem;
    font-weight: 700;
}

.pa-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin: 12px 0;
}

.pa-count {
    color: var(--muted,#6b7280);
}

.pa-tools {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.pa-search {
    min-width: 260px;
    padding: 10px 12px;
    border: 1px solid var(--border,#e5e7eb);
    border-radius: 12px;
    background: #fff;
}

.pa-select {
    min-width: 220px;
    padding: 10px 12px;
    border: 1px solid var(--border,#e5e7eb);
    border-radius: 12px;
    background: #fff;
}

.pa-alpha {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 12px;
}

    .pa-alpha a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        background: #fff;
        text-decoration: none;
        color: #0f172a;
        font-weight: 700;
    }

        .pa-alpha a[aria-disabled="true"] {
            opacity: .45;
            pointer-events: none;
        }

/* Sticky brand header above each group */
.pa-brand-section {
    scroll-margin-top: 80px;
}

.pa-brand-head {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--bg,#f7f8fb);
    padding: 6px 2px 6px 0;
    font-weight: 900;
    font-size: 1.05rem;
    color: #0f172a;
}

.pa-grid {
    --min: 300px;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(var(--min), 1fr));
}

@media (max-width: 980px) {
    .pa-layout {
        grid-template-columns: 1fr;
    }

    .pa-sidebar {
        position: static;
    }

    .pa-brand-head {
        top: -1px;
    }

    .pa-grid {
        --min: 260px;
    }
}

@media (max-width: 560px) {
    .pa-grid {
        --min: 220px;
    }

    .pa-hero-img {
        width: 60px;
        height: 60px;
    }
}

/* =========================
   Pattern index: spacing + brand header readability
   (paste AFTER your existing CSS so it overrides)
   ========================= */

/* More breathing room between cards */
.pa-grid {
    --min: 320px; /* was 300 */
    gap: 16px; /* was 12 */
}

@media (min-width: 1200px) {
    .pa-grid {
        --min: 340px;
    }
}

.pa-card {
    padding: 16px; /* a bit more padding */
    border-radius: 18px;
}

/* Space between brand groups */
.pa-brand-section {
    margin-top: 28px; /* more space above each brand */
    padding-top: 4px;
}

    .pa-brand-section + .pa-brand-section {
        margin-top: 32px; /* extra gap between consecutive brands */
    }

/* ===== Lime glass variant for clickable brand head ===== */
.pa-brand-head {
    display: block;
    position: sticky;
    top: 0;
    z-index: 1;
    margin: 6px 0 10px;
    padding: 10px 12px;
    /* glassy lime band */
    background: rgba(154, 215, 44, .10); /* var(--ring) @ 10% */
    color: #0f172a; /* dark ink for contrast */
    border: 1px solid rgba(154, 215, 44, .35); /* lime stroke */
    border-left: 6px solid rgba(154, 215, 44, .85); /* lime accent bar */
    border-radius: 12px;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(16,24,40,.08);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

    .pa-brand-head:hover {
        background: rgba(154, 215, 44, .16);
        border-color: rgba(154, 215, 44, .55);
        text-decoration: none;
    }

    .pa-brand-head:focus-visible {
        outline: 2px solid var(--ring);
        outline-offset: 2px;
    }

    /* divider uses a lime-tinted line for continuity */
    .pa-brand-head::after {
        content: "";
        display: block;
        height: 1px;
        background: linear-gradient(90deg, rgba(154,215,44,.00), rgba(154,215,44,.35), rgba(154,215,44,.00) );
        margin-top: 8px;
        border-radius: 999px;
    }

    /* air between header and its grid */
    .pa-brand-head + .pa-grid {
        margin-top: 10px;
    }

/* Sidebar rhythm unchanged, just keep it here for context */
.pa-brand-list li {
    margin-bottom: 6px;
}

    .pa-brand-list li a {
        padding: 10px 12px;
    }

/* Slightly larger gap between sidebar and main on md+ */
@media (max-width:980px) {
    .pa-layout {
        gap: 20px;
    }
}
