/**
 * H2JCatalog - Front-Office Styles
 * Uses H2J Design System variables exclusively
 *
 * @author    H2J Ecosystem <info@h2j.pro>
 * @copyright 2024-2026 H2J sas RCS 978391720
 * @license   Commercial license
 */

/* =============================================
   BRAND HUB PAGE
   ============================================= */

.h2j-brand-hub {
    padding: 1.5rem 0;
}

.h2j-brand-hub__title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--h2j-gate, #2c3e50);
    margin-bottom: 1rem;
}

/* A-Z Index */
.h2j-brand-az {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--h2j-border, #e5e7eb);
    margin-bottom: 1.5rem;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
}

.h2j-brand-az__letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--h2j-gate, #2c3e50);
    background: var(--h2j-bg-light, #f2f4f7);
    transition: background 0.15s, color 0.15s;
}

.h2j-brand-az__letter:hover,
.h2j-brand-az__letter--active {
    background: var(--h2j-primary, #6366f1);
    color: #fff;
}

.h2j-brand-az__letter--empty {
    opacity: 0.3;
    pointer-events: none;
}

.h2j-brand-az__count {
    font-size: 0.625rem;
    color: var(--h2j-muted, #999);
}

/* Brand Grid */
.h2j-brand-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.h2j-brand-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--h2j-border, #e5e7eb);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s, transform 0.15s;
}

.h2j-brand-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.h2j-brand-card__logo {
    max-width: 100%;
    height: auto;
    margin-bottom: 0.5rem;
}

.h2j-brand-card__logo--small { max-height: 60px; }
.h2j-brand-card__logo--medium { max-height: 100px; }
.h2j-brand-card__logo--large { max-height: 150px; }

.h2j-brand-card__name {
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    color: var(--h2j-gate, #2c3e50);
}

.h2j-brand-card__count {
    font-size: 0.75rem;
    color: var(--h2j-muted, #999);
}

/* Brand Hover Tooltip */
.h2j-brand-card__tooltip {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem;
    border-radius: 0 0 8px 8px;
    font-size: 0.8125rem;
    line-height: 1.4;
}

.h2j-brand-card:hover .h2j-brand-card__tooltip {
    display: block;
}

/* =============================================
   BRAND ON PRODUCT PAGE
   ============================================= */

.h2j-brand-product {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--h2j-border, #e5e7eb);
    margin-top: 0.75rem;
}

.h2j-brand-product__logo {
    max-height: 40px;
    width: auto;
}

.h2j-brand-product__name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--h2j-primary, #6366f1);
    text-decoration: none;
}

.h2j-brand-product__name:hover {
    text-decoration: underline;
}

/* =============================================
   CATEGORY BANNER
   ============================================= */

.h2j-cat-banner {
    position: relative;
    width: 100%;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
}

.h2j-cat-banner__img {
    width: 100%;
    height: auto;
    display: block;
}

.h2j-cat-banner__badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    background: var(--h2j-primary, #6366f1);
}

/* =============================================
   SIDEBAR CATEGORIES
   ============================================= */

.h2j-sidebar-cats__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.375rem 0;
    font-size: 0.875rem;
}

.h2j-sidebar-cats__icon {
    width: 16px;
    height: 16px;
    margin-right: 0.375rem;
}

.h2j-sidebar-cats__name {
    color: var(--h2j-gate, #2c3e50);
    text-decoration: none;
    flex: 1;
}

.h2j-sidebar-cats__name:hover {
    color: var(--h2j-primary, #6366f1);
}

.h2j-sidebar-cats__count {
    font-size: 0.75rem;
    color: var(--h2j-muted, #999);
    background: var(--h2j-bg-light, #f2f4f7);
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 768px) {
    .h2j-brand-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.75rem;
    }

    .h2j-brand-az {
        position: static;
    }

    .h2j-cat-banner__img--desktop { display: none; }
    .h2j-cat-banner__img--mobile { display: block; }
}

@media (min-width: 769px) {
    .h2j-cat-banner__img--mobile { display: none; }
    .h2j-cat-banner__img--desktop { display: block; }
}
