/**
 * H2JCatalog - Front-Office CSS
 * Replaces totmanufacturerpage styles
 *
 * @author    H2J Ecosystem <info@h2j.pro>
 * @copyright 2024-2026 H2J sas RCS 978391720
 * @license   Commercial license
 */

.h2jbrand { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: #333; line-height: 1.5; }
.h2jbrand *, .h2jbrand *::before, .h2jbrand *::after { box-sizing: border-box; }

.h2jbrand-title { font-size: 1.4rem; font-weight: 700; color: #222; margin: 0 0 1rem; text-transform: uppercase; }

/* ============================================= */
/* A-Z INDEX BAR (shared)                        */
/* ============================================= */
.h2jbrand-az-bar { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 1.25rem; padding: 8px 0; border-bottom: 1px solid #ddd; }
.h2jbrand-az-link { display: inline-block; padding: 2px 6px; font-size: 13px; font-weight: 600; color: #333; text-decoration: none; }
.h2jbrand-az-link:hover { color: #6366f1; text-decoration: underline; }
.h2jbrand-link { color: #333; text-decoration: none; font-size: 14px; line-height: 1.7; }
.h2jbrand-link:hover { color: #6366f1; text-decoration: underline; }

/* ============================================= */
/* MODE 1 : LIGNES DE MARQUES (Lines)            */
/* Table layout matching totmanufacturerpage      */
/* ============================================= */
.h2jbrand-table { width: 100%; border-collapse: collapse; border: 1px solid #ccc; }
.h2jbrand-table th, .h2jbrand-table td { border: 1px solid #ccc; padding: 10px 14px; vertical-align: top; }

/* Header row */
.h2jbrand-table thead tr { background: #f9f9f9; }
.h2jbrand-table__title { font-size: 16px; font-weight: 700; text-transform: uppercase; color: #222; text-align: left; white-space: nowrap; }
.h2jbrand-table__az { text-align: right; font-size: 0; white-space: nowrap; }
.h2jbrand-table__az .h2jbrand-az-link { display: inline; padding: 0 3px; font-size: 13px; }

/* Letter cell */
.h2jbrand-table__letter { font-size: 28px; font-weight: 700; color: #222; text-align: center; vertical-align: middle; width: 60px; min-width: 60px; background: #fafafa; }

/* Brand columns */
.h2jbrand-table__col { width: 25%; font-size: 14px; line-height: 1.8; }
.h2jbrand-table__col .h2jbrand-link { display: block; }

/* Hover row highlight */
.h2jbrand-table tbody tr:hover { background: #f5f7ff; }

/* Responsive: stack on mobile */
@media (max-width: 640px) {
    .h2jbrand-table__col { display: block; width: 100%; border: none; padding: 2px 10px; }
    .h2jbrand-table__letter { display: block; width: 100%; text-align: left; padding: 8px 14px; background: #f0f0f0; font-size: 22px; }
    .h2jbrand-table tbody tr { display: block; border-bottom: 2px solid #ccc; }
    .h2jbrand-table thead { display: none; }
    .h2jbrand-table__az { display: none; }
}

/* ============================================= */
/* MODE 2 : COLONNES TYPE 1                      */
/* ============================================= */
.h2jbrand-cols1-grid { display: flex; flex-wrap: wrap; gap: 0; }
.h2jbrand-cols1-section { flex: 0 0 25%; padding: 10px 14px; border-bottom: 1px solid #eee; }
.h2jbrand-cols1-letter { font-size: 22px; font-weight: 700; color: #222; margin-bottom: 4px; padding-bottom: 4px; border-bottom: 2px solid #6366f1; display: inline-block; }
.h2jbrand-cols1-list { display: flex; flex-direction: column; }
.h2jbrand-cols1-list .h2jbrand-link { padding: 2px 0; }

@media (max-width: 768px) {
    .h2jbrand-cols1-section { flex: 0 0 50%; }
}
@media (max-width: 480px) {
    .h2jbrand-cols1-section { flex: 0 0 100%; }
}

/* ============================================= */
/* MODE 3 : COLONNES TYPE 2                      */
/* ============================================= */
.h2jbrand-cols2-wrap { }
.h2jbrand-cols2-row { display: flex; border-bottom: 1px solid #eee; padding: 8px 0; }
.h2jbrand-cols2-letter { flex: 0 0 50px; font-size: 24px; font-weight: 700; color: #222; text-align: center; align-self: flex-start; padding-top: 2px; }
.h2jbrand-cols2-brands { flex: 1; display: flex; flex-wrap: wrap; gap: 0 20px; }
.h2jbrand-cols2-brands .h2jbrand-link { flex: 0 0 calc(25% - 15px); padding: 2px 0; }

@media (max-width: 768px) {
    .h2jbrand-cols2-brands .h2jbrand-link { flex: 0 0 calc(50% - 10px); }
}
@media (max-width: 480px) {
    .h2jbrand-cols2-brands .h2jbrand-link { flex: 0 0 100%; }
}

/* ============================================= */
/* MODE 4 : PHOTOS / LOGO GRID                   */
/* ============================================= */
.h2jbrand-search-wrap { margin-bottom: 1rem; }
.h2jbrand-search-input { width: 100%; max-width: 320px; padding: 8px 12px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px; }
.h2jbrand-search-input:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,.15); }

.h2jbrand-logo-grid { display: grid; gap: 16px; }
.h2jbrand-logo-small { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.h2jbrand-logo-medium { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.h2jbrand-logo-large { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.h2jbrand-card { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: inherit; border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px 12px 12px; transition: box-shadow .15s, transform .15s; position: relative; overflow: hidden; }
.h2jbrand-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); transform: translateY(-2px); }

.h2jbrand-card__img-wrap { position: relative; width: 100%; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; overflow: hidden; }
.h2jbrand-card__img-wrap img { max-width: 100%; height: auto; object-fit: contain; }
.h2jbrand-logo-small .h2jbrand-card__img-wrap img { max-height: 60px; }
.h2jbrand-logo-medium .h2jbrand-card__img-wrap img { max-height: 100px; }
.h2jbrand-logo-large .h2jbrand-card__img-wrap img { max-height: 150px; }

.h2jbrand-card__nologo { font-size: 28px; font-weight: 700; color: #aaa; text-transform: uppercase; }

/* Hover overlay for brand description */
.h2jbrand-card__overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 10px; font-size: 12px; line-height: 1.4; text-align: center; opacity: 0; transition: opacity .2s; background: var(--hover-bg, rgba(0,0,0,.75)); color: var(--hover-txt, #fff); }
.h2jbrand-card:hover .h2jbrand-card__overlay { opacity: 1; }

.h2jbrand-card__name { font-size: 13px; font-weight: 600; color: #333; text-align: center; }
.h2jbrand-card__count { font-size: 11px; color: #999; }

/* ============================================= */
/* MODE 5 : ORIGINAL (inline logos)              */
/* ============================================= */
.h2jbrand-inline-grid { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.h2jbrand-inline { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: #333; gap: 4px; }
.h2jbrand-inline img { max-height: 60px; width: auto; }
.h2jbrand-inline span { font-size: 11px; text-align: center; }

/* ============================================= */
/* BRAND ON PRODUCT PAGE                         */
/* ============================================= */
.h2jbrand-product { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid #e5e7eb; margin-top: 10px; }
.h2jbrand-product__link { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.h2jbrand-product__link:hover .h2jbrand-product__name { text-decoration: underline; }
.h2jbrand-product__logo { max-height: 80px; max-width: 180px; width: auto; height: auto; object-fit: contain; }
.h2jbrand-product__name { font-size: 14px; font-weight: 600; color: #333; }
.h2jbrand-product__desc { font-size: 12px; color: #666; margin: 4px 0 0; line-height: 1.4; }

/* ============================================= */
/* INDIVIDUAL BRAND PAGE                         */
/* ============================================= */
.h2jbrand-page { padding: 1rem 0; }
.h2jbrand-page__banner { margin-bottom: 1.5rem; border-radius: 8px; overflow: hidden; }
.h2jbrand-page__banner img { width: 100%; height: auto; display: block; }
.h2jbrand-page__header { display: flex; align-items: center; gap: 20px; margin-bottom: 1.5rem; }
.h2jbrand-page__logo { max-height: 120px; max-width: 250px; width: auto; height: auto; object-fit: contain; }
.h2jbrand-page__name { font-size: 1.5rem; font-weight: 700; color: #222; margin: 0; }
.h2jbrand-page__desc { font-size: 14px; line-height: 1.6; color: #555; }

/* ============================================= */
/* CATEGORY BANNER                               */
/* ============================================= */
.h2jbrand-cat-banner { position: relative; width: 100%; margin-bottom: 1.5rem; border-radius: 8px; overflow: hidden; }
.h2jbrand-cat-banner img { width: 100%; height: auto; display: block; }
.h2jbrand-cat-banner__badge { position: absolute; top: 10px; left: 10px; padding: 4px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; color: #fff; background: #6366f1; }

/* ============================================= */
/* SIDEBAR CATEGORIES                            */
/* ============================================= */
.h2jbrand-sidebar-item { display: flex; align-items: center; justify-content: space-between; padding: 5px 0; font-size: 14px; }
.h2jbrand-sidebar-name { color: #333; text-decoration: none; flex: 1; }
.h2jbrand-sidebar-name:hover { color: #6366f1; }
.h2jbrand-sidebar-count { font-size: 11px; color: #999; background: #f2f4f7; padding: 1px 6px; border-radius: 10px; }

/* ============================================= */
/* EMPTY STATE                                   */
/* ============================================= */
.h2jbrand-empty { text-align: center; padding: 40px; color: #999; font-size: 15px; }

/* ============================================= */
/* RESPONSIVE (mobile banner)                    */
/* ============================================= */
@media (max-width: 768px) {
    .h2jbrand-logo-grid { gap: 10px; }
    .h2jbrand-cat-banner img.desktop-only { display: none; }
    .h2jbrand-cat-banner img.mobile-only { display: block; }
}
@media (min-width: 769px) {
    .h2jbrand-cat-banner img.mobile-only { display: none; }
    .h2jbrand-cat-banner img.desktop-only { display: block; }
}
