/** ============================================
   smartgadget.space — style.css
   ============================================ **/

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:           #ffffff;
    --bg-main:      #f7f7f6;
    --bg-soft:      #f0f0ef;
    --bg-card:      #ffffff;
    --border:       #e8e8e7;
    --text:         #1a1a1a;
    --text-dark:    #3D3D3D;
    --text-faint:   #a0a0a0;
    --accent:       #c11c84;
    --accent-hover: #0d47a1;
    --sidebar-w:    250px;
    --header-h:     60px;
    --nav-h:        44px;
    --radius:       8px;
    --radius-sm:    5px;
    --shadow:       0 1px 3px rgba(0,0,0,0.06);
}

html { font-size: 16px; }

body {
    font-family: "Nunito", sans-serif;
    background: var(--bg-main);
    color: var(--text);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-weight: 500;
}

a { color: var(--text); text-decoration: none; }

/* ── HEADER ── */
.site-header {
    background: var(--bg-card);
    height: var(--header-h);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}
.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 28px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 20px;
}
.site-logo {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-dark);
}
.logo-domain { color: var(--accent); font-weight: 600; }
.site-tagline {
    font-size: 0.85rem;
    color: var(--text-faint);
    border-left: 2px solid var(--border);
    padding-left: 20px;
    font-weight: 500;
}

/* ── NAV HORIZONTALE ── */
.nav-top {
    background: var(--bg-card);
    height: var(--nav-h);
    box-shadow: var(--shadow);
}
.nav-top-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 28px 0 calc(28px + var(--sidebar-w));
    height: 100%;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
}
.nav-top-link {
    display: inline-block;
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-dark);
    white-space: nowrap;
    letter-spacing: 0.03em;
    transition: background 0.15s, color 0.15s;
}
.nav-top-link:hover { background: var(--bg-soft); color: var(--text); }
.nav-top-link.active { background: var(--bg-soft); color: var(--accent); font-weight: 800; }

/* ── LAYOUT ── */
.layout {
    display: flex;
    width: 100%;
    flex: 1;
    min-width: 0;
}

/* ── SIDEBAR ── */
.nav-side {
    width: var(--sidebar-w);
    flex-shrink: 0;
    min-height: calc(100vh - var(--header-h) - var(--nav-h));
    border-right: 1px solid var(--border);
}
.nav-side-inner {
    padding: 24px 16px 24px 12px;
    position: sticky;
    top: calc(var(--header-h) + var(--nav-h));
    height: calc(100vh - var(--header-h) - var(--nav-h));
    overflow-y: auto;
    overflow-x: hidden;
    font-family: "Nunito", sans-serif;

    /* Scrollbar discrète — Firefox */
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

/* Scrollbar discrète — Chrome / Edge / Safari */
.nav-side-inner::-webkit-scrollbar        { width: 4px; }
.nav-side-inner::-webkit-scrollbar-track  { background: transparent; }
.nav-side-inner::-webkit-scrollbar-thumb  {
    background-color: var(--border);
    border-radius: 4px;
}
.nav-side-inner::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-faint);
}
.nav-side-title {
    font-size: 0.73rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-faint);
    margin-bottom: 12px;
    padding-left: 8px;
    font-family: "Nunito", sans-serif;
}

/* Arbre */
.nav-tree { list-style: none; }

.tree-cat-btn, .tree-sc-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    padding: 6px 8px;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    text-align: left;
    font-family: "Nunito", sans-serif;
    transition: background 0.12s, color 0.12s;
}
.tree-cat-btn {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.tree-cat-btn:hover { background: var(--bg-soft); color: var(--accent); }
.tree-cat.active > .tree-cat-btn { color: var(--text-dark); }

.tree-icon {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--accent);
    flex-shrink: 0;
    width: 14px;
    text-align: center;
    line-height: 1;
}
.tree-label { flex: 1; text-transform: uppercase; }

.tree-count {
    font-size: 0.7rem;
    color: var(--text-faint);
    font-weight: 600;
    font-family: "Nunito", sans-serif;
}

.tree-sub, .tree-marques { list-style: none; display: none; padding-left: 16px; }
.tree-cat.open > .tree-sub { display: block; }
.tree-sc.open  > .tree-marques { display: block; }

.tree-sc-btn {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-dark);
    text-transform: uppercase;
    padding: 5px 8px;
    font-family: "Nunito", sans-serif;
}
.tree-sc-btn:hover { background: var(--bg-soft); color: var(--accent); }

.tree-marque-link {
    display: block;
    padding: 4px 8px 4px 22px;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-dark);
    border-radius: var(--radius-sm);
    font-family: "Nunito", sans-serif;
    transition: background 0.12s, color 0.12s;
}
.tree-marque-link:hover { background: var(--bg-soft); color: var(--accent); }
.tree-marque-link.active { color: var(--accent); font-weight: 800; }

.nav-side-actions {
    margin-top: 28px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.btn-side {
    display: block;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-dark);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    background: var(--bg-card);
    font-family: "Nunito", sans-serif;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.btn-side:hover { background: var(--bg-soft); color: var(--accent); border-color: var(--accent); }

/* ── CONTENU PRINCIPAL ── */
.main-content {
    flex: 1;
    min-width: 0;          /* essentiel pour que le flex ne déborde pas */
    padding: 16px 16px 16px 20px;
    overflow-x: clip;      /* clip ne crée pas de scroll-context → sticky thead fonctionne */
}

.content-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 6px;
    gap: 16px;
    flex-wrap: wrap;
}
.content-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.page-title {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-dark);
}
.result-count {
    font-size: 0.82rem;
    color: var(--text-faint);
    background: var(--bg-soft);
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 700;
}
.filtres-actifs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tag-filtre {
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2px 10px;
    color: var(--text-dark);
}
.clear-filtres { font-size: 0.75rem; color: var(--text-faint); font-weight: 700; transition: color 0.12s; }
.clear-filtres:hover { color: var(--accent); }

.btn-export {
    display: inline-block;
    padding: 7px 16px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-dark);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    font-family: "Nunito", sans-serif;
    transition: background 0.12s, border-color 0.12s;
    white-space: nowrap;
}
.btn-export:hover { background: var(--bg-soft); border-color: var(--accent); }

/* ── BARRE DE RECHERCHE + DATE ── */
.table-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.search-input {
    flex: 1;
    min-width: 180px;
    max-width: 400px;
    padding: 8px 14px;
    font-size: 0.9rem;
    font-family: "Nunito", sans-serif;
    font-weight: 500;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(193,28,132,0.1); }
.search-input::placeholder { color: var(--text-faint); }

/* ── WRAPPER LOUPE ── */
.search-wrapper {
    position: relative;
    flex: 1;
    min-width: 180px;
    max-width: 400px;
    display: flex;
    align-items: center;
}
.search-wrapper .search-input {
    flex: 1;
    min-width: 0;
    max-width: none;
    padding-left: 34px;
}
.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-faint);
    display: flex;
    align-items: center;
}

/* ── BOUTON FILTRE MOBILE ── */
.btn-filter-mobile {
    display: none;
    position: relative;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-faint);
    cursor: pointer;
    font-family: "Nunito", sans-serif;
    transition: border-color 0.12s, color 0.12s;
    flex-shrink: 0;
}
.btn-filter-mobile:hover,
.btn-filter-mobile[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.filter-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
}

/* ── PANNEAU FILTRES MOBILE ── */
.bloc-filtres { display: none; padding: 10px 0 6px; }
.bloc-filtres-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.filtre-select {
    flex: 1;
    min-width: 140px;
    padding: 7px 10px;
    font-size: 0.85rem;
    font-family: "Nunito", sans-serif;
    font-weight: 500;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text);
    outline: none;
    cursor: pointer;
}
.filtre-select:focus { border-color: var(--accent); }
.filtre-reset {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}
.filtre-reset:hover { background: var(--bg-soft); }

/* ── LISTE MOBILE (cartes) ── */
.mobile-list { display: none; }
.color-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1.5px solid rgba(0,0,0,0.12);
    flex-shrink: 0;
}

/* ── BOTTOM NAV (mobile only) ── */
.bottom-nav { display: none; }

.table-meta {
    font-size: 0.78rem;
    color: var(--text-faint);
    font-weight: 500;
    margin-left: auto;
    white-space: nowrap;
}
.table-meta strong { color: var(--text-dark); font-weight: 700; }

/* ── LIGNES CLIQUABLES ── */
#main-table tbody tr.row-clickable {
    cursor: pointer;
    transition: background 0.12s;
}
#main-table tbody tr.row-clickable:hover { background: var(--bg-soft); }

/* ── COLONNES MASQUÉES (tableau uniquement, pas export) ── */
.col-masquee { display: none; }

/* ── TABLEAU ── */
/* scrollbar miroir en haut du tableau */
.scroll-top-bar {
    overflow-x: auto;
    overflow-y: hidden;
    height: 12px;
    width: 100%;
    margin-bottom: 2px;
}
.scroll-top-bar::-webkit-scrollbar        { height: 6px; }
.scroll-top-bar::-webkit-scrollbar-track  { background: var(--bg); }
.scroll-top-bar::-webkit-scrollbar-thumb  { background: var(--border); border-radius: 3px; }
.scroll-top-inner { height: 1px; }   /* largeur fixée par JS */

.table-wrapper {
    overflow-x: auto;           /* scroll horizontal du tableau */
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
    background: var(--bg-card);
    box-shadow: var(--shadow);
    width: 100%;
}
.data-table {
    width: max-content;         /* laisse le tableau prendre sa vraie largeur */
    min-width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}
.data-table thead tr { background: var(--bg-soft); }
.data-table th {
    padding: 11px 14px;
    text-align: left;
    font-size: 0.71rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dark);
    white-space: nowrap;
    user-select: none;
    border-bottom: 2px solid var(--border);
    font-family: "Nunito", sans-serif;
}

/* ── Scrollbar fantôme (sous le thead fantôme) ── */
.ghost-scroll-top {
    position: fixed;
    height: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    z-index: 89;
    display: none;
    background: var(--bg);          /* fond opaque : cache le texte en dessous */
    border-bottom: 1px solid var(--border);
}
.ghost-scroll-top::-webkit-scrollbar        { height: 6px; }
.ghost-scroll-top::-webkit-scrollbar-track  { background: var(--bg); }
.ghost-scroll-top::-webkit-scrollbar-thumb  { background: var(--border); border-radius: 3px; }
.ghost-scroll-top > div { height: 1px; }

/* ── En-tête fantôme figé (géré par JS) ── */
.thead-ghost {
    position: fixed;
    top: 0;        /* valeur initiale, écrasée immédiatement par JS */
    z-index: 90;
    overflow: hidden;           /* masque le débordement horizontal */
    display: none;              /* caché par défaut, JS l'active */
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.thead-ghost table {
    border-collapse: collapse;
    width: max-content;
    font-size: 0.71rem;
    font-family: "Nunito", sans-serif;
}
.data-table th.sortable { cursor: pointer; transition: color 0.12s; }
.data-table th.sortable:hover { color: var(--accent); }
.sort-icon { margin-left: 4px; opacity: 0.35; }
.data-table td {
    padding: 9px 14px;
    color: var(--text);
    vertical-align: top;
    font-weight: 500;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--bg-soft); }
.cell-empty { color: var(--text-faint); }

/* ── ÉTAT VIDE ── */
.empty-state {
    padding: 56px 24px;
    text-align: center;
    color: var(--text-dark);
    font-size: 0.95rem;
    font-weight: 600;
}
.empty-state a { color: var(--accent); text-decoration: underline; }

/* ── PAGE IMPORT ── */
.import-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 24px;
    max-width: 600px;
    box-shadow: var(--shadow);
}
.import-desc {
    font-size: 0.88rem;
    color: var(--text-dark);
    margin-bottom: 20px;
    font-weight: 500;
    line-height: 1.6;
}
.import-form { display: flex; flex-direction: column; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-group label { font-size: 0.88rem; font-weight: 700; color: var(--text); }
.form-hint { font-size: 0.78rem; color: var(--text-faint); font-weight: 500; }
.categorie-input-group { display: flex; flex-direction: column; gap: 8px; }

.import-form select,
.import-form input[type="text"],
.import-form input[type="password"],
.import-form input[type="file"] {
    padding: 9px 12px;
    font-size: 0.9rem;
    font-family: "Nunito", sans-serif;
    font-weight: 500;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.import-form select:focus,
.import-form input[type="text"]:focus,
.import-form input[type="password"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(193,28,132,0.1);
}

.btn-primary {
    display: inline-block;
    padding: 10px 24px;
    background: var(--accent);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: "Nunito", sans-serif;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s;
    align-self: flex-start;
}
.btn-primary:hover { background: var(--accent-hover); }

.import-format {
    max-width: 600px;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 22px 26px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}
.import-format h2 {
    font-size: 0.88rem;
    font-weight: 800;
    margin-bottom: 14px;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: "Nunito", sans-serif;
}
.import-format pre {
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
    padding: 16px;
    font-size: 0.82rem;
    overflow-x: auto;
    margin-bottom: 12px;
    color: var(--text);
    line-height: 1.6;
}
.import-format code {
    font-family: 'Courier New', monospace;
    font-size: 0.82rem;
    color: var(--accent);
    background: var(--bg-soft);
    padding: 1px 5px;
    border-radius: 3px;
}
.import-format pre code { background: none; padding: 0; color: var(--text); }

.import-footer-actions { margin-top: 8px; padding-top: 16px; }
.btn-logout {
    background: none;
    border: none;
    font-size: 0.8rem;
    font-family: "Nunito", sans-serif;
    font-weight: 600;
    color: var(--text-faint);
    cursor: pointer;
    padding: 0;
    transition: color 0.12s;
}
.btn-logout:hover { color: var(--accent); }

/* ── ALERTES ── */
.alert {
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 20px;
    max-width: 600px;
}
.alert-success { background: #f0faf4; border: 1px solid #c3e6cb; color: #2d6a4f; }
.alert-error   { background: #fff5f5; border: 1px solid #f5c6cb; color: #721c24; }

/* ── FOOTER ── */
.site-footer {
    background: var(--bg-card);
    margin-top: auto;
    border-top: 1px solid var(--border);
}
.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 28px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-faint);
    display: flex;
    gap: 12px;
    align-items: center;
}
.footer-link {
    color: var(--text-faint);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.15s;
}
.footer-link:hover { color: var(--accent); }
.footer-sep { color: var(--border); }

/* ── BOUTON IMPORT FAB (Ctrl+I) ── */
#import-fab {
    display: none;
}
#import-fab.visible { display: inline-block; }

/* ============================================
   BURGER + DRAWER MOBILE
   ============================================ */

.header-burger { display: none; }
.footer-overlay { display: none; }

.drawer-close { display: none; }
.drawer-cats-mobile { display: none; }

/* ============================================
   PAGE DÉTAIL
   ============================================ */

/* Barre supérieure : retour + navigation précédent/suivant */
.detail-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.detail-topbar .detail-nav {
    flex: 1;
    margin: 0;
    padding: 0;
    border: none;
}
.detail-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-dark);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    font-family: "Nunito", sans-serif;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.detail-back:hover { background: var(--bg-soft); color: var(--accent); border-color: var(--accent); }

/* Grille principale */
.detail-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 28px;
    align-items: start;
}

/* ── Slider ── */
.detail-slider-col { display: flex; flex-direction: column; gap: 10px; }

.detail-slider-placeholder {
    aspect-ratio: 3/4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-faint);
    font-size: 0.88rem;
    font-weight: 600;
    font-family: "Nunito", sans-serif;
}
.placeholder-icon { font-size: 2.4rem; line-height: 1; }

.detail-slider-main {
    position: relative;
    aspect-ratio: 3/4;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.slider-img-main {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.92);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    color: var(--text-dark);
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    padding: 0;
}
.slider-arrow:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.slider-prev { left: 8px; }
.slider-next { right: 8px; }

.slider-thumbs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.slider-thumb {
    width: 56px;
    height: 72px;
    object-fit: contain;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: var(--bg-card);
    transition: border-color 0.12s;
}
.slider-thumb:hover,
.slider-thumb.active { border-color: var(--accent); }

/* ── Infos détail ── */
.detail-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 5px;
    font-family: "Nunito", sans-serif;
}
.detail-subtitle {
    font-size: 0.85rem;
    color: var(--text-faint);
    font-weight: 600;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: "Nunito", sans-serif;
}
.detail-badge {
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2px 10px;
    color: var(--text-dark);
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    font-family: "Nunito", sans-serif;
}
.detail-table th,
.detail-table td {
    padding: 9px 14px;
    text-align: left;
    font-size: 0.84rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    line-height: 1.5;
}
.detail-table tr:last-child th,
.detail-table tr:last-child td { border-bottom: none; }
.detail-table th {
    width: 38%;
    font-weight: 700;
    color: var(--text-faint);
    background: var(--bg-soft);
    white-space: nowrap;
}
.detail-table td { color: var(--text); font-weight: 500; }
.detail-table tr:hover td { background: var(--bg-soft); }

/* ── Navigation précédent / suivant (page détail) ── */
.detail-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0;
    border: none;
}
.detail-nav-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 1;
    padding: 6px 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
    text-decoration: none;
    color: var(--text-dark);
    transition: border-color 0.15s, background 0.15s;
    min-width: 0;
}
.detail-nav-btn:hover {
    border-color: var(--accent);
    background: var(--bg-light);
}
.detail-nav-disabled { flex: 1; visibility: hidden; }
.detail-nav-prev     { flex-direction: row; }
.detail-nav-next     { flex-direction: row-reverse; text-align: right; }
.detail-nav-arrow {
    font-size: 0.95rem;
    color: var(--accent);
    flex-shrink: 0;
}
/* Label : libellé + nom sur une seule ligne */
.detail-nav-label {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    min-width: 0;
}
.detail-nav-label small {
    font-size: 0.68rem;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    flex-shrink: 0;
}
.detail-nav-label strong {
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   RESPONSIVE MOBILE (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {

    /* Header mobile */
    .site-header { height: auto; }
    .header-inner {
        display: flex;
        flex-direction: row;
        align-items: center;
        padding: 10px 16px 10px;
        gap: 0;
        flex-wrap: wrap;
    }
    .logo-mark { display: none; }
    .site-tagline {
        width: 100%;
        border-left: none;
        padding-left: 0;
        padding-top: 2px;
        font-size: 0.72rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        order: 1;
    }
    .site-logo { order: 0; }

    /* Burger header */
    .header-burger {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        width: 36px;
        height: 36px;
        background: none;
        border: none;
        cursor: pointer;
        margin-right: 12px;
        padding: 4px;
        flex-shrink: 0;
        order: -1;
    }
    .header-burger span {
        display: block;
        width: 22px;
        height: 2px;
        background: var(--text-dark);
        border-radius: 2px;
        transition: background 0.15s, transform 0.2s, opacity 0.2s;
    }
    .header-burger.active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .header-burger.active span:nth-child(2) {
        opacity: 0;
    }
    .header-burger.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Panneau footer-inner — masqué par défaut sur mobile */
    .footer-inner {
        display: none;
        position: fixed;
        bottom: 60px;
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-top: 1px solid var(--border);
        padding: 16px 20px;
        z-index: 300;
        text-align: center;
        justify-content: center;
        box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
        max-width: none;
        margin: 0;
    }
    .footer-inner.visible {
        display: flex;
    }

    /* Overlay sombre derrière le panneau */
    .footer-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.3);
        z-index: 299;
    }
    .footer-overlay.visible {
        display: block;
    }

    /* Nav top → remplacée par le drawer */
    .nav-top { display: none; }

    /* thead-ghost : top calculé dynamiquement par JS, rien à surcharger ici */

    /* Layout */
    .layout { flex-direction: column; }

    /* Sidebar → Drawer */
    .nav-side {
        display: block;
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100%;
        background: var(--bg-card);
        z-index: 300;
        overflow-y: auto;
        border-right: 1px solid var(--border);
        box-shadow: 2px 0 12px rgba(0,0,0,0.1);
        transition: left 0.28s ease;
        min-height: unset;
    }
    .nav-side.open { left: 0; }
    .nav-side-inner { padding: 20px 16px; position: static; height: auto; overflow-y: visible; }
    .nav-side-title { margin-top: 8px; }

    /* Bouton fermer drawer */
    .drawer-close {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-bottom: 16px;
        margin-bottom: 4px;
        border-bottom: 1px solid var(--border);
    }
    .drawer-close-btn {
        background: none;
        border: none;
        font-size: 1.3rem;
        cursor: pointer;
        color: var(--text-faint);
        padding: 4px 8px;
        border-radius: var(--radius-sm);
        font-family: "Nunito", sans-serif;
        line-height: 1;
    }
    .drawer-close-label {
        font-size: 0.85rem;
        font-weight: 800;
        color: var(--text-faint);
        text-transform: uppercase;
        letter-spacing: 0.06em;
        font-family: "Nunito", sans-serif;
    }

    /* Liens catégories rapides dans le drawer */
    .drawer-cats-mobile {
        display: flex;
        flex-direction: column;
        gap: 2px;
        margin-bottom: 20px;
        padding-bottom: 16px;
        border-bottom: 1px solid var(--border);
    }
    .drawer-cat-link {
        display: block;
        padding: 8px 10px;
        font-size: 0.82rem;
        font-weight: 800;
        font-family: "Nunito", sans-serif;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--text-dark);
        border-radius: var(--radius-sm);
        transition: background 0.12s, color 0.12s;
    }
    .drawer-cat-link:hover { background: var(--bg-soft); color: var(--accent); }
    .drawer-cat-link.active { color: var(--accent); background: var(--bg-soft); }

    /* Contenu */
    .main-content { padding: 16px 12px; }

    /* Tableau scroll horizontal */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .data-table { min-width: 600px; font-size: 0.78rem; }
    .data-table th { padding: 8px 10px; font-size: 0.65rem; }
    .data-table td { padding: 7px 10px; white-space: nowrap; }

    /* Toolbar */
    .table-toolbar { flex-wrap: nowrap; gap: 8px; }
    .search-wrapper { flex: 1; min-width: 0; max-width: 100%; }
    .search-wrapper .search-input { max-width: 100%; width: 100%; min-width: unset; }
    .table-meta { display: none; }

    /* Filtre mobile */
    .btn-filter-mobile { display: flex; }
    .bloc-filtres { padding: 8px 0 4px; }

    /* Cartes mobile / masquer tableau */
    .table-wrapper { display: none !important; }
    .scroll-top-bar { display: none; }
    .mobile-list { display: block; }
    .mobile-card {
        background: var(--bg-card);
        border-radius: var(--radius);
        border: 1px solid var(--border);
        padding: 12px 14px;
        margin-bottom: 8px;
        cursor: pointer;
    }
    .mobile-row1,
    .mobile-row2 {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        flex-wrap: nowrap;
    }
    .mobile-row1 { margin-bottom: 5px; }
    .mobile-modele {
        font-size: 0.82rem;
        font-weight: 800;
        color: var(--text-dark);
        flex: 1;
        min-width: 0;
        margin-right: 8px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-align: left;
    }
    .mobile-code {
        font-size: 0.68rem;
        font-weight: 500;
        color: var(--text-faint);
        margin-left: 3px;
    }
    .mobile-date {
        font-size: 0.72rem;
        font-weight: 600;
        color: var(--text-faint);
        white-space: nowrap;
        flex-shrink: 0;
        text-align: right;
    }
    .mobile-connectique {
        font-size: 0.72rem;
        color: var(--text-faint);
        font-weight: 500;
        flex: 1;
        min-width: 0;
        margin-right: 8px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-align: left;
    }
    .mobile-couleurs {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 3px;
    }
    .color-dot {
        display: inline-block;
        width: 13px;
        height: 13px;
        border-radius: 50%;
        border: 1.5px solid rgba(0,0,0,0.12);
        flex-shrink: 0;
    }

    /* Content header */
    .content-header { flex-direction: column; gap: 8px; }
    .content-header-right { width: 100%; }
    .btn-export { width: 100%; text-align: center; display: block; }

    /* Page title */
    .page-title { font-size: 1.1rem; }

    /* Bottom nav */
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: var(--bg-card);
        border-top: 1px solid var(--border);
        z-index: 200;
        box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
    }
    .bottom-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        text-decoration: none;
        color: var(--text-faint);
        font-size: 0.6rem;
        font-weight: 700;
        font-family: "Nunito", sans-serif;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        padding: 6px 4px;
        transition: color 0.12s;
    }
    .bottom-nav-item svg { display: block; }
    .bottom-nav-item:hover,
    .bottom-nav-item.active { color: var(--accent); }

    /* Décalage contenu */
    .main-content { padding-bottom: 72px; }

    /* Détail responsive */
    .detail-layout { grid-template-columns: 1fr; }
    .detail-slider-col { max-width: 100%; }
    .detail-slider-main,
    .detail-slider-placeholder { aspect-ratio: 4/3; max-height: 320px; }
    .slider-thumbs { gap: 6px; }
    .slider-thumb  { width: 48px; height: 60px; }
    .detail-table th { width: 45%; }
    .detail-nav { display: none; }
}

@media (min-width: 769px) {
    .mobile-list    { display: none; }
    .header-burger  { display: none !important; }
    .footer-overlay { display: none !important; }
    .footer-inner   { display: flex !important; position: static !important; max-width: 1400px; margin: 0 auto; }
}
