/* ═══════════════════════════════════════
   PEINTURA — Catalogue des gammes (/gammes/) et section gammes des fiches marques
   S'appuie sur pages.css (variables --pg-*).
   ═══════════════════════════════════════ */

/* Hero */
.gm-hero .pg-hero-inner { padding-bottom: 3.4rem; }
.gm-hero .pg-hero-content { max-width: 680px; }

.gm-main { padding-top: 1.4rem; padding-bottom: 3rem; }

/* Onglets familles */
.gm-tabs {
    display: flex; gap: .3rem; background: #fff; border: 1px solid var(--pg-line); border-radius: 14px;
    padding: .35rem; box-shadow: 0 6px 22px rgba(14,24,71,.06); margin-bottom: 1.6rem;
    overflow-x: auto; scrollbar-width: thin;
}
.gm-tab {
    flex: 1 0 auto; display: flex; align-items: center; justify-content: center; gap: .6rem;
    padding: .8rem 1.1rem; border-radius: 10px; color: var(--pg-navy); text-decoration: none;
    font-weight: 600; font-size: .95rem; white-space: nowrap; position: relative;
}
.gm-tab + .gm-tab::before {
    content: ""; position: absolute; left: -.2rem; top: 25%; bottom: 25%; width: 1px; background: var(--pg-line);
}
.gm-tab:hover { background: var(--pg-soft); }
.gm-tab.is-active { background: var(--pg-blue); color: #fff; box-shadow: 0 6px 16px rgba(11,94,215,.28); }
.gm-tab.is-active::before, .gm-tab.is-active + .gm-tab::before { display: none; }
.gm-tab em {
    font-style: normal; font-size: .72rem; font-weight: 700; min-width: 1.4rem; height: 1.4rem; padding: 0 .35rem;
    display: inline-flex; align-items: center; justify-content: center; border-radius: 999px;
    background: #eef3fb; color: var(--pg-blue);
}
.gm-tab.is-active em { background: rgba(255,255,255,.2); color: #fff; }

/* Filtres */
.gm-filters .pg-filters-title { width: 100%; background: none; border: 0; font: inherit; font-size: 1.1rem; font-weight: 700; color: var(--pg-navy); cursor: default; text-align: left; }
.gm-filters .pg-filters-title svg { display: none; }
.gm-fsearch {
    width: 100%; height: 38px; padding: 0 .8rem; margin-bottom: .55rem; border: 1px solid var(--pg-line); border-radius: 8px;
    font: inherit; font-size: .86rem; color: var(--pg-text); background: #fff;
}
.gm-fsearch:focus { outline: 2px solid rgba(11,94,215,.25); border-color: var(--pg-blue); }
.gm-flist .gm-more { display: none; }
.gm-flist.is-expanded .gm-more, .gm-flist.is-searching .pg-check { display: flex; }
.gm-flist.is-searching .pg-check.is-hidden { display: none; }
.gm-showmore {
    display: inline-flex; align-items: center; gap: .3rem; margin-top: .35rem; padding: 0; border: 0; background: none;
    color: var(--pg-blue); font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer;
}
.gm-showmore svg { transform: rotate(90deg); transition: transform .2s; }
.gm-showmore[aria-expanded="true"] svg { transform: rotate(-90deg); }

/* En-tête des résultats */
.gm-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.gm-count { font-size: 1.15rem; font-weight: 700; color: var(--pg-navy); margin: 0; }
.gm-sort { display: inline-flex; align-items: center; gap: .6rem; font-size: .9rem; color: var(--pg-muted); }

/* Cartes gammes */
.gm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; }
.gm-card {
    display: flex; flex-direction: column; background: #fff; border: 1px solid var(--pg-line); border-radius: 14px;
    overflow: hidden; text-decoration: none; color: inherit; box-shadow: 0 6px 20px rgba(14,24,71,.06);
    transition: transform .18s, box-shadow .18s;
}
.gm-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(14,24,71,.12); }
.gm-card-media { position: relative; aspect-ratio: 5 / 2; overflow: hidden; background: var(--pg-soft); }
.gm-card-media > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.gm-badge {
    position: absolute; left: .8rem; top: .8rem; display: inline-flex; align-items: center; max-width: 60%;
    height: 38px; padding: .3rem .6rem; border-radius: 6px; background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.12);
    font-weight: 800; font-size: .95rem; letter-spacing: .02em; color: var(--pg-navy); text-transform: uppercase;
}
.gm-badge img { max-height: 100%; max-width: 120px; object-fit: contain; display: block; }
.gm-card-body { display: flex; flex-direction: column; gap: .35rem; padding: .9rem 1rem 1rem; flex: 1; }
.gm-card-brand { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.gm-card-title {
    display: flex; align-items: center; justify-content: space-between; gap: .5rem;
    font-size: 1.22rem; font-weight: 700; color: var(--pg-navy); margin: 0; line-height: 1.25;
}
.gm-go { color: var(--pg-blue); flex-shrink: 0; display: inline-flex; }
.gm-card-desc { font-size: .88rem; line-height: 1.5; color: var(--pg-text); margin: 0; }
.gm-card-foot { margin-top: auto; padding-top: .6rem; display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.gm-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.gm-chip { font-size: .78rem; font-weight: 600; color: var(--pg-navy); background: #eef3fb; padding: .28rem .7rem; border-radius: 999px; }
.gm-nb { font-size: .84rem; color: var(--pg-text); white-space: nowrap; }

/* État vide */
.gm-empty-state {
    text-align: center; background: #fff; border: 1px dashed var(--pg-line); border-radius: 14px; padding: 3rem 1.5rem;
    color: var(--pg-muted);
}
.gm-empty-state svg { color: var(--pg-blue); }
.gm-empty-state h2 { color: var(--pg-navy); font-size: 1.3rem; margin: .8rem 0 .4rem; }
.gm-empty-state p { max-width: 520px; margin: 0 auto 1.2rem; }
.gm-btn {
    display: inline-flex; align-items: center; gap: .5rem; background: var(--pg-blue); color: #fff; text-decoration: none;
    font-weight: 700; padding: .75rem 1.3rem; border-radius: 999px;
}

/* Texte SEO de la famille */
.gm-seo { margin-top: 2.6rem; background: #fff; border-radius: 14px; border: 1px solid var(--pg-line); padding: 1.6rem 1.8rem; }
.gm-seo h2 { font-size: 1.25rem; color: var(--pg-navy); margin: 0 0 .7rem; }
.gm-seo p { color: var(--pg-text); line-height: 1.65; margin: 0 0 .8rem; }

/* ─── Section « Gammes et produits » de la fiche marque ─── */
.bg-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0 1.1rem; }
.bg-tab {
    display: inline-flex; align-items: center; gap: .45rem; border: 1px solid var(--pg-line); background: #fff;
    border-radius: 999px; padding: .5rem .95rem; font: inherit; font-size: .88rem; font-weight: 600; color: var(--pg-navy); cursor: pointer;
}
.bg-tab em { font-style: normal; color: var(--pg-muted); font-weight: 600; }
.bg-tab[aria-selected="true"] { background: var(--pg-blue); border-color: var(--pg-blue); color: #fff; }
.bg-tab[aria-selected="true"] em { color: rgba(255,255,255,.8); }
.bg-panel[hidden] { display: none; }
.bg-range { border: 1px solid var(--pg-line); border-radius: 12px; padding: 1rem 1.1rem; margin-bottom: .8rem; background: #fff; scroll-margin-top: 110px; }
.bg-range:target { border-color: var(--pg-blue); box-shadow: 0 0 0 3px rgba(11,94,215,.15); }
.bg-range-head { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.bg-range h3 { font-size: 1.08rem; color: var(--pg-navy); margin: 0; }
.bg-range-meta { font-size: .82rem; color: var(--pg-muted); }
.bg-range p { font-size: .88rem; color: var(--pg-text); margin: .35rem 0 .6rem; line-height: 1.5; }
.bg-products { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; list-style: none; padding: 0; margin: .5rem 0 0; }
.bg-products a {
    display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .55rem .75rem;
    border-radius: 8px; background: var(--pg-soft); text-decoration: none; color: var(--pg-navy); font-weight: 600; font-size: .9rem;
}
.bg-products a:hover { background: #e9f0fb; }
.bg-products small { display: block; font-weight: 500; color: var(--pg-muted); font-size: .78rem; }

@media (max-width: 1180px) {
    .gm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
    .gm-filters .pg-filters-title { cursor: pointer; }
    .gm-filters .pg-filters-title svg { display: block; }
    .gm-filters-toggle {
        justify-content: center !important; gap: .6rem; background: var(--pg-blue) !important; color: #fff !important;
        border-radius: 10px !important; padding: .75rem 1rem !important;
    }
    .gm-filters { padding: .5rem; }
    .gm-filters.is-open { padding: .5rem .9rem 1rem; }
    .gm-filters.is-open .gm-filters-toggle { border-bottom: 0 !important; margin-bottom: .4rem; }
    .gm-tab span { display: inline; }
}
@media (max-width: 680px) {
    .gm-grid { grid-template-columns: minmax(0, 1fr); }
    .gm-tab { padding: .7rem .85rem; font-size: .88rem; }
    .gm-head { flex-direction: column; align-items: flex-start; }
    .bg-products { grid-template-columns: minmax(0, 1fr); }
    .gm-seo { padding: 1.2rem; }
}

/* ─── Pages « Gammes d'une marque » et « Gamme » ─── */
button.gm-tab { border: 0; background: none; font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; }
button.gm-tab.is-active { background: var(--pg-blue); }
.gm-card[hidden], .bg-products li[hidden], .mg-others[hidden] { display: none; }
.mg-id { display: flex; align-items: center; gap: 1.1rem; }
.mg-logo { flex-shrink: 0; width: 96px; height: 96px; border-radius: 16px; background: #fff; display: inline-flex; align-items: center; justify-content: center; padding: .7rem; box-shadow: 0 8px 22px rgba(0,0,0,.18); }
.mg-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.mg-h1-brand { display: block; font-size: .5em; font-weight: 700; opacity: .85; letter-spacing: .02em; text-transform: uppercase; margin-top: .25rem; }
.mg-grid { margin-bottom: 1.6rem; }
.mg-others { margin-top: .4rem; }
.mg-others h2 { display: flex; align-items: center; gap: .55rem; }
.mg-note { color: var(--pg-muted); font-size: .9rem; margin: .2rem 0 .6rem; }
.mg-back { margin-top: 1.6rem; }
.mg-back .fx-link svg { transform: rotate(180deg); }
.mg-text { color: var(--pg-text); line-height: 1.65; margin: 0 0 .8rem; }
.mg-products { display: flex; flex-direction: column; gap: .6rem; }
.mg-prod {
    display: flex; align-items: center; gap: .9rem; padding: .85rem 1rem; border-radius: 12px; background: var(--pg-soft);
    text-decoration: none; color: var(--pg-text); border: 1px solid transparent; transition: border-color .15s, background .15s;
}
.mg-prod:hover { background: #fff; border-color: var(--pg-blue); }
.mg-prod-body { display: flex; flex-direction: column; gap: .2rem; flex: 1; min-width: 0; }
.mg-prod-body strong { color: var(--pg-navy); font-size: 1rem; }
.mg-prod-body small { color: var(--pg-muted); font-size: .85rem; }
.mg-prod-meta { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .2rem; }
.mg-prod-meta span { font-size: .76rem; font-weight: 600; color: var(--pg-navy); background: #fff; border: 1px solid var(--pg-line); padding: .15rem .55rem; border-radius: 999px; }
@media (max-width: 680px) { .mg-logo { width: 64px; height: 64px; } .mg-id { gap: .8rem; } }

/* Fiche marque : aperçu des gammes */
.mb-ranges-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .9rem; }
.mb-ranges-head h2 { margin: 0; }
.mb-ranges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.mb-range { display: flex; flex-direction: column; gap: .3rem; padding: .9rem 1rem; border-radius: 12px; background: var(--pg-soft); text-decoration: none; border: 1px solid transparent; transition: border-color .15s, background .15s; }
.mb-range:hover { background: #fff; border-color: var(--pg-blue); }
.mb-range strong { color: var(--pg-navy); font-size: 1rem; }
.mb-range small { color: var(--pg-muted); font-size: .84rem; line-height: 1.45; }
.mb-range-foot { margin-top: auto; padding-top: .3rem; display: flex; align-items: center; justify-content: space-between; font-size: .82rem; font-weight: 600; color: var(--pg-blue); }
.mb-others { margin: .9rem 0 0; font-size: .88rem; color: var(--pg-muted); line-height: 1.6; }
.mb-others a { color: var(--pg-blue); font-weight: 600; text-decoration: none; }
.mb-others a:hover { text-decoration: underline; }
@media (max-width: 680px) { .mb-ranges { grid-template-columns: minmax(0, 1fr); } }

/* ─── Cartes produits (pages familles et peintures d'une marque) ─── */
.pc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.pc-card {
    display: flex; flex-direction: column; gap: .45rem; padding: 1rem 1.1rem 1rem; background: #fff;
    border: 1px solid var(--pg-line); border-radius: 14px; box-shadow: 0 6px 18px rgba(14,24,71,.06);
    transition: transform .15s, box-shadow .15s;
}
.pc-card:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(14,24,71,.11); }
.pc-top { display: flex; align-items: center; justify-content: space-between; gap: .6rem; min-height: 34px; }
.pc-brand { display: inline-flex; align-items: center; height: 32px; font-weight: 800; font-size: .9rem; letter-spacing: .03em; text-transform: uppercase; color: var(--pg-navy); text-decoration: none; }
.pc-brand img { height: 100%; width: auto; max-width: 110px; object-fit: contain; }
.pc-range { font-size: .78rem; font-weight: 600; color: var(--pg-blue); background: #eef3fb; padding: .2rem .6rem; border-radius: 999px; white-space: nowrap; }
.pc-name { margin: .1rem 0 0; font-size: 1.08rem; line-height: 1.3; }
.pc-name a { color: var(--pg-navy); text-decoration: none; }
.pc-name a:hover { color: var(--pg-blue); }
.pc-line { margin: 0; font-size: .86rem; color: var(--pg-muted); }
.pc-meta { list-style: none; margin: .2rem 0 0; padding: .55rem 0 0; border-top: 1px solid var(--pg-line); display: flex; flex-direction: column; gap: .25rem; }
.pc-meta li { display: flex; justify-content: space-between; gap: .6rem; font-size: .82rem; }
.pc-meta span { color: var(--pg-muted); }
.pc-meta b { color: var(--pg-navy); font-weight: 600; text-align: right; }
.pc-link { margin-top: auto; padding-top: .5rem; font-size: .88rem; font-weight: 700; color: var(--pg-blue); text-decoration: none; }
.pc-link:hover { text-decoration: underline; }
.gm-rbrand { color: var(--pg-muted); font-size: .76rem; }
.pg-check[hidden] { display: none !important; }
@media (max-width: 1180px) { .pc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .pc-grid { grid-template-columns: minmax(0, 1fr); } }
.mb-fams { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 0; }
.mb-fam { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .85rem; border-radius: 999px; border: 1px solid var(--pg-line); background: #fff; color: var(--pg-navy); font-size: .86rem; font-weight: 600; text-decoration: none; }
.mb-fam svg { color: var(--pg-blue); }
.mb-fam em { font-style: normal; font-size: .74rem; color: var(--pg-blue); background: #eef3fb; padding: .05rem .45rem; border-radius: 999px; }
.mb-fam:hover { border-color: var(--pg-blue); }
.gm-fhint { display: block; font-size: .72rem; font-weight: 500; color: var(--pg-muted); margin-top: .1rem; }
