/* ============================================================
   BRANDS CATALOG GRID  –  brands-catalog.css
   ============================================================ */

/* ── Variables ── */
:root {
    --bcg-blue:      #1a56db;
    --bcg-blue-dark: #1342b0;
    --bcg-border:    #e2e6ea;
    --bcg-bg:        #ffffff;
    --bcg-card-bg:   #ffffff;
    --bcg-text:      #1a202c;
    --bcg-muted:     #6b7280;
    --bcg-radius:    10px;
    --bcg-shadow:    0 2px 12px rgba(0,0,0,.07);
    --bcg-shadow-hv: 0 6px 24px rgba(26,86,219,.13);
    --bcg-transition: .22s cubic-bezier(.4,0,.2,1);
}

/* ── Wrapper ── */
.bcg-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    color: var(--bcg-text);
    max-width: 100%;
    margin: 0 auto;
    padding: 0 4px;
}

/* ── Control bar ── */
.bcg-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

/* ── Filter dropdown ── */
.bcg-filter-wrap {
    position: relative;
}

.bcg-filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1.5px solid var(--bcg-border);
    border-radius: var(--bcg-radius);
    background: var(--bcg-bg);
    font-size: 14px;
    font-weight: 500;
    color: var(--bcg-text);
    cursor: pointer;
    white-space: nowrap;
    transition: border-color var(--bcg-transition);
    min-width: 170px;
    justify-content: space-between;
}
.bcg-filter-btn:hover,
.bcg-filter-btn[aria-expanded="true"] {
    border-color: var(--bcg-blue);
}

.bcg-caret {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    transition: transform var(--bcg-transition);
}
.bcg-filter-btn[aria-expanded="true"] .bcg-caret {
    transform: rotate(180deg);
}

.bcg-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 200px;
    background: var(--bcg-bg);
    border: 1.5px solid var(--bcg-border);
    border-radius: var(--bcg-radius);
    box-shadow: var(--bcg-shadow);
    padding: 6px 0;
    margin: 0;
    list-style: none;
    z-index: 100;
    display: none;
    max-height: 300px;
    overflow-y: auto;
}
.bcg-dropdown.open {
    display: block;
}

.bcg-opt {
    padding: 9px 18px;
    font-size: 14px;
    cursor: pointer;
    transition: background var(--bcg-transition), color var(--bcg-transition);
}
.bcg-opt:hover {
    background: #f0f4ff;
    color: var(--bcg-blue);
}
.bcg-opt.active {
    color: var(--bcg-blue);
    font-weight: 600;
    background: #f0f4ff;
}

/* ── Search ── */
.bcg-search-wrap {
    flex: 1;
    min-width: 200px;
    position: relative;
}
.bcg-search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--bcg-muted);
    pointer-events: none;
}
.bcg-search {
    width: 100%;
    padding: 9px 14px 9px 38px;
    border: 1.5px solid var(--bcg-border);
    border-radius: var(--bcg-radius);
    font-size: 14px;
    color: var(--bcg-text);
    background: var(--bcg-bg);
    outline: none;
    transition: border-color var(--bcg-transition), box-shadow var(--bcg-transition);
    box-sizing: border-box;
}
.bcg-search:focus {
    border-color: var(--bcg-blue);
    box-shadow: 0 0 0 3px rgba(26,86,219,.1);
}
.bcg-search::placeholder {
    color: var(--bcg-muted);
}

/* ── View toggle ── */
.bcg-view-toggle {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.bcg-view-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 14px;
    border: 1.5px solid var(--bcg-border);
    border-radius: var(--bcg-radius);
    background: var(--bcg-bg);
    font-size: 14px;
    font-weight: 500;
    color: var(--bcg-muted);
    cursor: pointer;
    transition: all var(--bcg-transition);
    white-space: nowrap;
}
.bcg-view-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.bcg-view-btn.active {
    background: var(--bcg-blue);
    border-color: var(--bcg-blue);
    color: #ffffff;
}
.bcg-view-btn:not(.active):hover {
    border-color: var(--bcg-blue);
    color: var(--bcg-blue);
}

/* ── Grid container ── */
.bcg-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.bcg-grid.list-view {
    grid-template-columns: 1fr;
    gap: 12px;
}

/* ── Card ── */
.bcg-card {
    background: var(--bcg-card-bg);
    border: 1.5px solid var(--bcg-border);
    border-radius: var(--bcg-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow var(--bcg-transition), transform var(--bcg-transition);
}
.bcg-card:hover {
    box-shadow: var(--bcg-shadow-hv);
    transform: translateY(-2px);
}

/* Logo area */
.bcg-card-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 0px;
    min-height: 72px;
}
.bcg-card-logo img {
    width: 100%;
    object-fit: contain;
}
.bcg-logo-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--bcg-text);
    text-align: center;
}

/* Description */
.bcg-card-desc {
    font-size: 12.5px;
    color: var(--bcg-muted);
    text-align: center;
    padding: 4px 18px 10px;
    line-height: 1.5;
    flex: 1;
}

/* Product image */
.bcg-card-img {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 20px 12px;
    min-height: 90px;
}
.bcg-card-img img {
    max-height: 90px;
    max-width: 100%;
    object-fit: contain;
}
.bcg-img-placeholder {
    width: 80px;
    height: 80px;
    background: #f0f4ff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Footer / download link */
.bcg-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    gap: 8px;
}
.bcg-dl-link {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 500;
    color: var(--bcg-blue);
    text-decoration: none !important;
    transition: color var(--bcg-transition);
    width: 100%;
    border: #d2d2d2 solid 1px;
    border-radius: 10px;
    text-align: center;
    padding: 5px 10px;
}
.bcg-dl-link:hover {
    color: var(--bcg-blue-dark);
    text-decoration: none;
}
.bcg-dl-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: border-color var(--bcg-transition), background var(--bcg-transition);
    color: var(--bcg-blue);
}
.bcg-dl-icon svg {
    width: 14px;
    height: 14px;
}
.bcg-dl-link:hover .bcg-dl-icon {
    border-color: var(--bcg-blue);
    background: #f0f4ff;
}

/* ── LIST VIEW card override ── */
.bcg-grid.list-view .bcg-card {
    flex-direction: row;
    align-items: center;
    padding: 14px 20px;
    gap: 20px;
}
.bcg-grid.list-view .bcg-card-logo {
    padding: 0;
    min-height: unset;
    flex-shrink: 0;
    width: 130px;
    justify-content: flex-start;
}
.bcg-grid.list-view .bcg-card-img {
    display: none;
}
.bcg-grid.list-view .bcg-card-desc {
    padding: 0;
    text-align: left;
    font-size: 13.5px;
    flex: 1;
}
.bcg-grid.list-view .bcg-card-footer {
    border-top: none;
    padding: 0;
    flex-shrink: 0;
}
.bcg-grid.list-view .bcg-card-logo img {
    max-height: 36px;
    max-width: 110px;
}
.bcg-grid.list-view .bcg-logo-text {
    font-size: 16px;
}

/* ── Empty state ── */
.bcg-empty {
    text-align: center;
    color: var(--bcg-muted);
    padding: 48px 0;
    font-size: 15px;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .bcg-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
    .bcg-grid { grid-template-columns: repeat(2, 1fr); }
    .bcg-view-btn span { display: none; }
    .bcg-bar { gap: 8px; }
}
@media (max-width: 400px) {
    .bcg-grid { grid-template-columns: 1fr; }
}
