/* style.css */
:root {
    --color-primary: #0077b6; /* Un bleu plus vibrant */
    --color-primary-dark: #295491;
    --color-secondary: #21bdd0;
    --color-white: #ffffff;
    /* RGB variants for consistent rgba usage */
    --color-primary-rgb: 0, 119, 182;
    --color-primary-dark-rgb: 41, 84, 145;
    --color-secondary-rgb: 33, 189, 208;
    --color-background: #f8f9fa;
    --color-surface: #ffffff;
    --color-text-primary: #212529;
    --color-text-secondary: #6c757d;
    --color-border: #dee2e6;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --transition-fast: all 0.2s ease-in-out;
    --transition-normal: all 0.3s ease;
    /* Tech background variables */
    --tech-line: rgba(2, 132, 199, 0.10); /* cyan/blue lines */
    --tech-line-2: rgba(33, 189, 208, 0.08); /* secondary accent lines */
    --tech-glow: rgba(33, 189, 208, 0.12);
    --tech-pulse: rgba(255, 255, 255, 0.20);
}

html {
    scroll-behavior: smooth;
}

/* Minimal reset and box-sizing for a clean base */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img { display: block; max-width: 100%; }
button { border: 0; background: transparent; }

body {
    font-family: 'Inter', sans-serif;
    font-size: 16px; /* Augmentation pour la lisibilité */
    background-color: var(--color-background);
    color: var(--color-text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* ===== Futuristic tech background (subtle and performant) ===== */
body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}

/* Circuit-like lines grid with gentle drift */
body::before {
    background-image:
        /* fine vertical lines */
        linear-gradient(to right, transparent 0, transparent 95px, var(--tech-line) 96px, transparent 97px),
        /* fine horizontal lines */
        linear-gradient(to bottom, transparent 0, transparent 95px, var(--tech-line) 96px, transparent 97px),
        /* secondary diagonals for subtle complexity */
        linear-gradient(135deg, transparent 0, transparent 48px, var(--tech-line-2) 49px, transparent 50px),
        radial-gradient(600px 300px at 20% 10%, var(--tech-glow), transparent 60%),
        radial-gradient(500px 250px at 80% 85%, var(--tech-glow), transparent 60%);
    background-size: 120px 120px, 120px 120px, 240px 240px, auto, auto;
    background-position: 0 0, 0 0, 0 0, 0 0, 0 0;
    animation: techDrift 60s linear infinite;
    opacity: 0.9; /* overall layer transparency */
}

/* Light pulses like current flowing */
body::after {
    background: radial-gradient(60px 40px at 10% -10%, var(--tech-pulse), transparent 70%),
                radial-gradient(80px 50px at 90% 110%, var(--tech-pulse), transparent 70%);
    mix-blend-mode: screen; /* soft additive glow */
    animation: techPulse 14s ease-in-out infinite alternate;
    opacity: 0.45;
}

@keyframes techDrift {
    0%   { background-position: 0 0, 0 0, 0 0, 0 0, 0 0; }
    100% { background-position: 240px 0, 0 240px, 240px 240px, 0 0, 0 0; }
}

@keyframes techPulse {
    0%   { transform: translate3d(0,0,0); opacity: 0.35; }
    50%  { transform: translate3d(0,-10px,0); opacity: 0.5; }
    100% { transform: translate3d(0,0,0); opacity: 0.35; }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    body::before, body::after { animation: none; }
}

/* Dark mode tuning for background */
body[data-theme="dark"] {
    --tech-line: rgba(148, 163, 184, 0.07); /* slate-400 low alpha */
    --tech-line-2: rgba(33, 189, 208, 0.07);
    --tech-glow: rgba(0, 119, 182, 0.10);
    --tech-pulse: rgba(33, 189, 208, 0.18);
}

main {
    flex-grow: 1;
}

.section-title {
    border-bottom: 3px solid var(--color-primary-dark);
    padding-bottom: 0.75rem;
    margin-bottom: 2rem;
    color: var(--color-primary-dark);
    font-size: 28px;
    font-weight: 700;
}

.logo {
    height: 60px; /* Légère réduction pour un header plus fin */
    width: auto;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .logo {
        height: 40px;
    }
}

.hero-section {
    background-image: url('https://universcarte.com/images/banniere-engrenage-support-v.gif');
    background-size: cover;
    background-position: center;
    color: var(--color-surface);
    padding: 4rem 2rem; /* Réduction du padding vertical */
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: 3rem;
    text-align: center;
}



.hero-section h1 {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hero-section .relative {
    width: 100%;
    max-width: 600px;
    margin: 1.5rem auto 0;
}

.hero-section input[type="text"] {
    width: 100%;
    height: 52px;
    padding-left: 3.5rem !important;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 9999px;
    transition: var(--transition-fast);
    font-size: 1rem;
}

.hero-section input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.hero-section input[type="text"]:focus {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: var(--color-surface);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.hero-section .search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.8);
}

.hero-section #clearSearchBtn {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
}

/* ===== Category index chips (all categories view) ===== */
.sv-cat-index { --chip-bg: #f1f5f9; --chip-color:#334155; }
body[data-theme="dark"] .sv-cat-index { --chip-bg: #1e293b; --chip-color:#e2e8f0; }
.sv-cat-index .sv-cat-chip {
    display:inline-flex;
    align-items:center;
    gap:0.35rem;
    padding:0.4rem 0.9rem;
    font-size:0.75rem;
    font-weight:600;
    letter-spacing:.03em;
    text-transform:uppercase;
    border-radius:9999px;
    background:var(--chip-bg);
    color:var(--chip-color);
    text-decoration:none;
    border:1px solid rgba(0,0,0,0.05);
    transition:background .18s ease, color .18s ease, box-shadow .18s ease;
}
body[data-theme="dark"] .sv-cat-index .sv-cat-chip { border-color: rgba(255,255,255,0.08); }
.sv-cat-index .sv-cat-chip:hover, .sv-cat-index .sv-cat-chip:focus-visible {
    background: var(--color-primary);
    color:#fff;
    box-shadow:0 2px 4px rgba(var(--color-primary-rgb),0.4);
}
/* Anchor offset so headings are not hidden under sticky index or nav */
.anchor-offset { scroll-margin-top: 7rem; }
@media (min-width:768px){ .anchor-offset { scroll-margin-top: 8.5rem; } }

/* Datasheet button minor refinement */
.datasheet-btn { line-height:1.2; }
body[data-theme="dark"] .datasheet-btn.bg-slate-200 { background:#334155 !important; color:#e2e8f0 !important; }
body[data-theme="dark"] .datasheet-btn.bg-slate-200:hover { background:#475569 !important; }

/* === Unified buttons === */
.sv-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem; /* ~text-sm */
    text-decoration: none;
    border: 1px solid transparent;
    transition: background-color .18s ease, color .18s ease, box-shadow .18s ease, transform .08s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.sv-btn-block { display: inline-flex; width: 100%; justify-content: center; }
.sv-btn i { font-size: 0.9em; }
.sv-btn:hover { box-shadow: 0 6px 14px rgba(0,0,0,0.10); transform: translateY(-1px); }
.sv-btn:active { transform: translateY(0); box-shadow: 0 3px 8px rgba(0,0,0,0.10); }
.sv-btn:focus-visible { outline: 3px solid rgba(var(--color-primary-dark-rgb), 0.3); outline-offset: 2px; }

.sv-btn-sm { padding: 0.45rem 0.65rem; font-size: 0.8125rem; }

.sv-btn-primary {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 2px 6px rgba(var(--color-primary-rgb), 0.25);
}
.sv-btn-primary:hover { background: var(--color-primary-dark); box-shadow: 0 8px 18px rgba(var(--color-primary-dark-rgb), 0.35); }
.sv-btn-primary:focus-visible { outline: 3px solid rgba(var(--color-primary-dark-rgb), 0.45); }

.sv-btn-secondary {
    background: #e2e8f0; /* slate-200 */
    color: #334155;      /* slate-700 */
    border-color: rgba(0,0,0,0.05);
}
.sv-btn-secondary:hover { background: #cbd5e1; color: #0f172a; }
body[data-theme="dark"] .sv-btn-secondary { background:#334155; color:#e2e8f0; border-color: rgba(255,255,255,0.08); }
body[data-theme="dark"] .sv-btn-secondary:hover { background:#475569; color:#fff; }

.general-section-bg {
    background-color: var(--color-surface);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 3rem;
}

.card-item {
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08); /* un peu plus marquée pour le contraste */
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    background-color: var(--color-white);
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid rgba(0,0,0,0.06); /* bordure subtile pour détacher du fond clair */
}

.card-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.12);
}

.card-item h3 {
    margin-top: 1rem;
    font-size: 1.1rem;
    line-height: 1.5;
    flex-grow: 1;
    color: var(--color-text-primary);
}

.card-item .text-sm {
    margin-top: 0.5rem;
    color: var(--color-text-secondary);
}

.related-product-link {
    display: inline-block;
    padding: 0.375rem 1rem;
    background-color: var(--color-background);
    color: var(--color-primary-dark);
    border: 1px solid var(--color-border);
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition-fast);
    text-decoration: none;
}

.related-product-link:hover {
    background-color: var(--color-primary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.model-card {
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.5s ease-out forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.model-card-image-wrapper {
    position: relative;
    height: 192px; /* standardized model image height */
    overflow: hidden;
    background-color: #fff; /* avoid dark letterboxing when images are contained */
}

.model-card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* prevent zoom/crop */
    object-position: center;
}

/* Ensure generic .card-item img styles don't override model image behavior */
.model-card .model-card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.model-card-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(var(--color-secondary-rgb), 0.27);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 1rem;
    gap: 0.75rem;
}

.model-card:hover .model-card-overlay {
    opacity: 1;
}

/* Accessibilité clavier: afficher l'overlay quand un lien interne reçoit le focus */
.model-card:focus-within .model-card-overlay {
    opacity: 1;
}

/* Dark mode: subtle shiny inner highlight under borders for model cards */
body[data-theme="dark"] .model-card {
    position: relative;
    z-index: 0; /* create a stacking context */
}
body[data-theme="dark"] .model-card::before {
    content: "";
    position: absolute;
    inset: 1px; /* stay just inside the border */
    border-radius: calc(0.75rem - 1px);
    pointer-events: none;
    z-index: 0;
    /* soft top inner sheen */
    background:
      radial-gradient(140% 60% at 50% -8%, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.05) 40%, rgba(255,255,255,0.0) 65%);
}
body[data-theme="dark"] .model-card::after {
    content: "";
    position: absolute;
    left: 1px; right: 1px; bottom: 1px; height: 16px; /* narrow glossy strip at bottom */
    border-bottom-left-radius: calc(0.75rem - 1px);
    border-bottom-right-radius: calc(0.75rem - 1px);
    pointer-events: none;
    z-index: 0;
    background: linear-gradient(to top, rgba(255,255,255,0.12), rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.0));
}
/* Ensure overlays sit above the glossy highlights */
.model-card .model-card-overlay { z-index: 1; }

/* =====================
   CTA "Je ne trouve pas mon modèle" styles
   ===================== */
.cta-help-card .cta-hero {
    background: linear-gradient(160deg, #f8fafc 0%, #ffffff 50%, #f1f5f9 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center; /* vertical centering */
    justify-content: center;
}
.cta-help-card .cta-hero-link {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    z-index: 1;
}
/* badge removed as requested */
.cta-help-card .cta-hero-text { text-align: center; }
.cta-help-card .cta-hero-title { color: #111827; font-weight: 700; }
.cta-help-card .cta-hero-sub { color: #475569; font-size: 0.9rem; }

/* Shimmer removed */
/* pulse removed */

/* Hover lift */
/* no badge hover */
/* With explicit buttons, no need to underline title on hover */
.cta-help-card .cta-hero-link:hover .cta-hero-title { text-decoration: none; }

/* Dark mode variant */
body[data-theme="dark"] .cta-help-card .cta-hero {
    background: linear-gradient(160deg, #0f172a 0%, #0b1220 50%, #0f172a 100%);
}
/* no badge in dark mode */
body[data-theme="dark"] .cta-help-card .cta-hero-title { color: #e5e7eb; }
body[data-theme="dark"] .cta-help-card .cta-hero-sub { color: #94a3b8; }
/* Shimmer removed in dark mode as well */

/* Accessibility: focus and reduced motion */
.cta-help-card .cta-hero-link:focus-visible {
    outline: 3px solid #3b82f6;
    outline-offset: 4px;
    border-radius: 14px;
}

/* =====================
   FAQ styles
   ===================== */
/* Modern FAQ look */
.faq-list .faq-item {
    border: 1px solid rgba(148,163,184,0.25);
    background: radial-gradient(140% 140% at 50% 0%, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.9) 60%, rgba(255,255,255,0.88) 100%);
    border-radius: 0.75rem;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.faq-list .faq-item:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,0,0,0.08); }
.faq-item summary { list-style: none; cursor: pointer; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item .faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
}
.faq-item .faq-q-text { font-weight: 700; color: var(--color-text-primary); }
.faq-item .faq-metas { display: inline-flex; align-items: center; gap: 0.5rem; }
.faq-item .faq-chevron { transition: transform 0.2s ease, opacity 0.2s ease; opacity: 0.7; }
.faq-item[open] .faq-chevron { transform: rotate(180deg); opacity: 1; }
.faq-item .faq-category {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-size: 0.75rem; font-weight: 600;
    color: #0f172a; background: rgba(var(--color-secondary-rgb), 0.18); border: 1px solid rgba(var(--color-secondary-rgb), 0.35);
    padding: 0.15rem 0.5rem; border-radius: 999px;
}
.faq-item .faq-answer {
    padding: 0.25rem 1.1rem 1rem 1.1rem;
    color: var(--color-text-primary); /* higher contrast for readability */
    line-height: 1.7;
}
.faq-item .faq-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.faq-item .faq-link {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background: var(--color-background);
    color: var(--color-primary-dark);
    border: 1px solid var(--color-border);
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600; font-size: 0.85rem;
}
.faq-item .faq-link:hover { background: var(--color-primary-dark); color: white; }
.faq-item .faq-answer p, .faq-item .faq-answer li { color: var(--color-text-primary); }
.faq-highlight { background: rgba(255, 246, 133, 0.55); padding: 0 2px; border-radius: 3px; }

/* Inline links injected in FAQ for brands/software with themed colors */
.faq-brand-link, .faq-software-link {
    color: #295491; /* requested light mode color for brands/software */
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 600;
}
.faq-brand-link:hover, .faq-software-link:hover {
    color: #1f3f6e;
}
body[data-theme="dark"] .faq-brand-link,
body[data-theme="dark"] .faq-software-link {
    color: #21bdd0; /* requested dark mode color */
}
body[data-theme="dark"] .faq-brand-link:hover,
body[data-theme="dark"] .faq-software-link:hover {
    color: #58d6e4;
}

/* Filter buttons reuse .filter-button visuals where possible */
#faq-categories .filter-button { padding: 0.35rem 0.75rem; }

/* Dark mode for FAQ */
body[data-theme="dark"] .faq-item {
    background: radial-gradient(140% 140% at 50% 0%, rgba(2,6,23,0.86) 0%, rgba(2,6,23,0.82) 60%, rgba(2,6,23,0.80) 100%);
    border-color: rgba(148,163,184,0.22);
    box-shadow: 0 10px 28px rgba(0,0,0,0.35);
}
body[data-theme="dark"] .faq-item .faq-q-text { color: #e5e7eb; }
body[data-theme="dark"] .faq-item .faq-answer { color: #cbd5e1; }
/* Improve bold emphasis visibility in dark mode without over-contrasting */
body[data-theme="dark"] .faq-item .faq-answer strong,
body[data-theme="dark"] .faq-item .faq-answer b {
    color: #21bcd079; /* slightly brighter than base text */
    font-weight: 700; /* ensure stronger weight is applied consistently */
}
body[data-theme="dark"] .faq-item .faq-category { color: #e2f3f5; background: rgba(var(--color-secondary-rgb), 0.15); border-color: rgba(var(--color-secondary-rgb), 0.35); }
body[data-theme="dark"] .faq-item .faq-link { background: #0b1220; color: #cbd5e1; border-color: rgba(148,163,184,0.25); }
body[data-theme="dark"] .faq-item .faq-link:hover { background: var(--color-primary-dark); color: white; }

/* Target highlight when navigating with hash */
.scroll-target-highlight { outline: 3px solid rgba(var(--color-secondary-rgb), 0.9); outline-offset: 3px; animation: targetFlash 2.2s ease-out 1; }
@keyframes targetFlash {
    0% { outline-color: rgba(255,255,255,0); }
    10% { outline-color: rgba(var(--color-secondary-rgb), 0.9); }
    50% { outline-color: rgba(var(--color-secondary-rgb), 0.4); }
    100% { outline-color: rgba(255,255,255,0); }
}
@media (prefers-reduced-motion: reduce) {
    /* shimmer and badge removed */
}

/* CTA hero with dual-action buttons (mail + WhatsApp) */
.cta-help-card .cta-hero { padding: 1.25rem; }
.cta-help-card .cta-hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}
.cta-help-card .cta-hero-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
}
.cta-action-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.8rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    border: 1px solid transparent;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.cta-action-button:focus-visible {
    outline: 3px solid rgba(59,130,246,0.9);
    outline-offset: 3px;
}
.cta-action--mail {
    background: #111827;
    color: #fff;
}
.cta-action--mail:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(17,24,39,0.25); }

.cta-action--whatsapp {
    background: #25D366;
    color: #0b1220;
}
.cta-action--whatsapp:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(37,211,102,0.38); }

/* Dark mode adjustments */
body[data-theme="dark"] .cta-action--mail { background: #e5e7eb; color: #0b1220; }
body[data-theme="dark"] .cta-action--whatsapp { background: #22c55e; color: #052e16; }

@media (max-width: 420px) {
    .cta-help-card .cta-hero-actions { flex-direction: column; width: 100%; }
    .cta-action-button { justify-content: center; }
}

.overlay-button-videos {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(var(--color-primary-dark-rgb), 0.5);
    color: white;
    border-radius: 0.75rem;
    width: 4.5rem; height: 3rem;
    font-size: 1.5rem;
    transition: background-color 0.2s ease;
    cursor: pointer;
    border: none;
}
.overlay-button-videos i { padding-left: 0.25rem; }
.overlay-button-videos:hover { transform: scale(1.06); background: var(--color-primary-dark); box-shadow: 0 10px 24px rgba(var(--color-primary-dark-rgb), 0.4); }

/* Focus-visible feedback for keyboard users */
.overlay-button-videos:focus-visible {
    outline: 3px solid rgba(var(--color-primary-dark-rgb), 0.45);
    outline-offset: 3px;
}

/* Align corners and prevent overflow */
.card-item { overflow: hidden; border-radius: 0.75rem; }
.model-card-image-wrapper {
    border-top-left-radius: 0.75rem;
    border-top-right-radius: 0.75rem;
    border-bottom-left-radius: 0.75rem;
    border-bottom-right-radius: 0.75rem;
    overflow: hidden;
}

.overlay-button-datasheet {
    display: inline-flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    color: var(--color-primary-dark);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}
.overlay-button-datasheet:hover {
    background-color: var(--color-primary-dark); /* bleu au survol */
    color: #fff;
    border-color: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(var(--color-primary-dark-rgb), 0.28);
}
.overlay-button-datasheet:focus-visible {
    outline: 3px solid rgba(var(--color-primary-dark-rgb), 0.35);
    outline-offset: 2px;
}
/* Icon spacing for datasheet button */
.overlay-button-datasheet i { margin-left: 0.5rem; }

.video-category h3 {
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
    color: var(--color-primary-dark);
    font-size: 22px;
    font-weight: 600;
}

/* Unified category title styling for video sections */
.category-title {
    color: var(--color-primary-dark);
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
    background-color: #e9ecef;
}

.video-wrapper iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: 0;
}

    /* Lightweight YouTube placeholder */
    .lite-yt { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; cursor: pointer; overflow: hidden; border-radius: 0.5rem; }
    .lite-yt picture, .lite-yt img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
    /* Removed black gradient overlay over video thumbnails */
    /* Position the play button like model overlay and reuse .overlay-button-videos visuals */
    .lite-yt-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
    .lite-yt-play i { font-size: 1.25rem; margin-left: 0.25rem; }
    .lite-yt:hover .lite-yt-play, .lite-yt:focus-visible .lite-yt-play { transform: translate(-50%, -50%) scale(1.06); }

.footer {
    background-color: var(--color-primary-dark);
    color: #e9ecef;
}
.footer .text-link { color: #e9ecef; text-decoration: none; transition: color 0.2s; }
.footer .text-link:hover { color: var(--color-secondary); }

.floating-contact-sidebar {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background-color: var(--color-surface);
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    padding: 0.75rem 0.6rem;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    transition: var(--transition-fast);
    backdrop-filter: blur(8px);
    border: 1px solid var(--color-border);
}

.contact-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem; height: 3rem;
    color: var(--color-primary-dark);
    text-decoration: none;
    border-radius: 9999px;
    background-color: transparent;
    transition: width 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden; /* allow pill expansion reveal */
    white-space: nowrap;
    padding: 0; /* will expand on hover */
}
.contact-button--whatsapp {
    background-color: #25D366; /* WhatsApp green */
    color: #0b1220;
}
.contact-button--whatsapp i { color: #0b1220; }
.contact-button--whatsapp .button-text { color: #0b1220; }
.contact-button--whatsapp:hover,
.contact-button--whatsapp:focus-visible {
    background-color: #1ac357;
    box-shadow: 0 8px 16px rgba(37, 211, 102, 0.35);
}
.contact-button:hover,
.contact-button:focus-visible { 
    width: auto; /* expand to fit text */
    padding: 0 1.2rem; /* horizontal padding for pill */
    background-color: var(--color-secondary);
    box-shadow: 0 8px 16px rgba(var(--color-secondary-rgb), 0.35);
}
.contact-button:focus-visible {
    outline: 3px solid rgba(var(--color-primary-dark-rgb), 0.45);
    outline-offset: 3px;
}
.contact-button i {
    font-size: 1.25rem;
    transition: var(--transition-normal);
}

/* (Styles de consentement supprimés) */
/* Inline label reveal inside the pill on hover */
.contact-button .button-text {
    visibility: hidden;
    opacity: 0;
    max-width: 0;
    margin-left: 0;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--color-primary-dark);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.contact-button:hover .button-text,
.contact-button:focus-visible .button-text {
    visibility: visible;
    opacity: 1;
    max-width: 200px;
    margin-left: 0.7rem;
}

/* Keep the sidebar open while hovered/focused: expand all buttons and reveal labels */
.floating-contact-sidebar:hover .contact-button,
.floating-contact-sidebar:focus-within .contact-button {
    width: auto;
    padding: 0 1.2rem;
}
.floating-contact-sidebar:hover .contact-button .button-text,
.floating-contact-sidebar:focus-within .contact-button .button-text {
    visibility: visible;
    opacity: 1;
    max-width: 200px;
    margin-left: 0.7rem;
}

.assistant-button {
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: var(--transition-fast);
    color: white;
    font-weight: 500;
    padding: 0.6rem 1.2rem;
    border-radius: 9999px;
}

.assistant-button:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

#video-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin: 1rem 0 2.5rem;
}

/* Breadcrumb as soft pills (tube) */
#breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
#breadcrumb a {
    display: inline-flex;
    align-items: center;
    height: 2rem;
    padding: 0 0.75rem;
    border-radius: 9999px;
    background: radial-gradient(120% 120% at 50% 0%, rgba(255,255,255,0.90) 0%, rgba(255,255,255,0.75) 45%, rgba(255,255,255,0.65) 100%);
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 4px 16px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.4);
    color: #334155; /* slate-600 */
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
#breadcrumb a:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0,0,0,0.10), inset 0 1px 0 rgba(255,255,255,0.45); }
#breadcrumb .current {
    font-weight: 600;
    color: #0f172a; /* slate-900 */
}
#breadcrumb .separator-icon { opacity: 0.6; padding: 0 0.25rem; }

/* Dark mode variant for breadcrumb pills */
body[data-theme="dark"] #breadcrumb a {
    background: radial-gradient(120% 120% at 50% 0%, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.05) 45%, rgba(255,255,255,0.03) 100%);
    border: 1px solid #1f2937;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.048), 0 8px 20px rgba(0,0,0,0.35);
    color: #cbd5e1; /* slate-300 */
}
body[data-theme="dark"] #breadcrumb .current { color: #e5e7eb; }

.filter-button {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    transition: var(--transition-fast);
    padding: 0.6rem 1.2rem;
    border-radius: 9999px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
}

.filter-button.active,
.filter-button:hover {
    background-color: var(--color-primary-dark);
    color: white;
    border-color: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.brand-card {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px; /* Hauteur augmentée pour les logos */
    padding: 1rem;
}

.brand-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Keep brand logos readable in dark mode (most PNG logos are dark on transparent) */
/* Modern logo tile for both brand and software cards (applied to wrapper or anchor) */
.logo-tile,
.brand-card a,
.software-card a {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    border-radius: 0.75rem;
    background: radial-gradient(120% 120% at 50% 0%, rgba(255,255,255,0.90) 0%, rgba(255,255,255,0.75) 45%, rgba(255,255,255,0.65) 100%);
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.logo-tile img,
.brand-card img,
.software-card img { width: 100%; height: 100%; object-fit: contain; }
.brand-card:hover .logo-tile,
.software-card:hover .logo-tile,
.brand-card:hover a,
.software-card:hover a { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(0,0,0,0.10), inset 0 1px 0 rgba(255,255,255,0.45); }

/* Dark mode variant (glass-like) */
body[data-theme="dark"] .logo-tile,
body[data-theme="dark"] .brand-card a,
body[data-theme="dark"] .software-card a {
    /* Plus de lumière pour améliorer le contraste en sombre */
    background: radial-gradient(120% 120% at 50% 0%, rgba(255,255,255,0.90) 0%, rgba(255,255,255,0.75) 45%, rgba(255,255,255,0.65) 100%);
    border: 1px solid #334155; /* slate-700 */
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06), 0 12px 30px rgba(0,0,0,0.40);
}
/* Survol: légère hausse de luminosité en sombre */
body[data-theme="dark"] .brand-card:hover a,
body[data-theme="dark"] .software-card:hover a {
    background: radial-gradient(120% 120% at 50% 0%, rgba(156, 232, 243, 0.2) 0%, rgba(112, 195, 218, 0.14) 45%, rgba(115, 198, 221, 0.08) 100%);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08), 0 16px 36px rgba(0,0,0,0.45);
}
/* Logos: petit boost lisibilité en sombre (subtil) */
body[data-theme="dark"] .brand-card img,
body[data-theme="dark"] .software-card img {
    filter: brightness(1.06) contrast(1.05);
}
body[data-theme="dark"] .brand-card { background-color: var(--color-surface); }
body[data-theme="dark"] .brand-card img { background-color: transparent; }

.quick-search-button {
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.quick-search-button:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Prevent image overflow inside cards */
.card-item img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Software cards: logos should occupy the full card surface */
.software-card {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px; /* aligner sur la hauteur des marques */
    padding: 1rem; /* même padding que .brand-card */
}
.software-card a { display: flex; }

/* Video iframe wrapper already clips via border-radius; ensure overflow hidden */
.video-wrapper {
    overflow: hidden;
}

@media (max-width: 768px) {
    body { font-size: 15px; }
    .floating-contact-sidebar {
        right: 1rem; bottom: 1rem;
        top: auto;
        transform: none;
        width: auto;
        padding: 0.5rem;
        flex-direction: row;
        border-radius: var(--radius-lg);
    }
    .contact-button { width: 2.5rem; height: 2.5rem; }
    .contact-button .button-text { display: none; }
    .contact-button i { font-size: 1rem; }

    nav .container { flex-wrap: wrap; justify-content: space-between; }
    nav .flex-grow { order: 3; width: 100%; margin-top: 1rem; }
    nav h1 { font-size: 1.25rem; text-align: center; }
    .logo { height: 48px; }

    .hero-section { padding: 4rem 1.5rem; }
    .hero-section h1 { font-size: 2rem; }
    .hero-section p { font-size: 1.1rem; }
     .hero-section input[type="text"] { height: 48px; font-size: 0.9rem; }
     /* Ne pas forcer toutes les grilles en 1 colonne sur mobile afin que
         les logos (marques/logiciels) restent en 2 colonnes par défaut */
    .card-item { margin-bottom: 1.5rem; }
    .general-section-bg { padding: 1.5rem; }
    #breadcrumb { margin-bottom: 1.5rem; }
}

@media (max-width: 480px) {
    .section-title { font-size: 24px; }
    .hero-section h1 { font-size: 1.75rem; }
    .hero-section p { font-size: 1rem; }
    .filter-button, .assistant-button { font-size: 0.85rem; padding: 0.5rem 1rem; }
}

/* ======================
   Dark mode theme
   Activated by setting data-theme="dark" on <html> (preferred) or <body>
   ====================== */
:root[data-theme="dark"], body[data-theme="dark"] {
    --color-background: #0b1220; /* slate-950-ish */
    --color-surface: #0f172a;    /* slate-900 */
    --color-text-primary: #e5e7eb; /* gray-200 */
    --color-text-secondary: #94a3b8; /* slate-400 */
    --color-border: #334155;     /* slate-700 */
}

/* Base backgrounds and text */
body[data-theme="dark"],
:root[data-theme="dark"] body {
    background-color: var(--color-background);
    color: var(--color-text-primary);
}

/* Nav override (Tailwind bg-white/80 in HTML) */
/* Scope the dark nav background to only the fixed top header, not the breadcrumb */
body[data-theme="dark"] nav.fixed {
    background-color: rgba(2, 6, 23, 0.7) !important; /* slate-950 with alpha */
    color: var(--color-text-primary);
}
body[data-theme="dark"] nav.fixed h1 { color: var(--color-text-primary); }

/* Cards and containers */
body[data-theme="dark"] .general-section-bg { background-color: var(--color-surface); box-shadow: 0 4px 12px rgba(0,0,0,0.35); }
body[data-theme="dark"] .card-item { background-color: var(--color-surface); border-color: rgba(255,255,255,0.06); box-shadow: 0 4px 12px rgba(0,0,0,0.35); }
body[data-theme="dark"] .card-item h3 { color: var(--color-text-primary); }
body[data-theme="dark"] .card-item .text-sm { color: var(--color-text-secondary); }

/* Section titles and borders */
body[data-theme="dark"] .section-title,
body[data-theme="dark"] .category-title,
body[data-theme="dark"] .video-category h3 { color: var(--color-secondary); border-color: #1f2937; }

/* Dark mode: search results brand headings */
body[data-theme="dark"] .search-brand-section h3 {
    color: var(--color-secondary) !important; /* ensure override of Tailwind text-gray-800 */
}
body[data-theme="dark"] .search-brand-section .border-b {
    border-color: #1f2937 !important; /* match other dark separators */
}

/* Buttons and pills */
body[data-theme="dark"] .related-product-link { background-color: rgba(148,163,184,0.08); color: #dbeafe; border-color: #334155; }
body[data-theme="dark"] .related-product-link:hover { background-color: var(--color-primary-dark); color: #fff; }

/* Filters */
body[data-theme="dark"] .filter-button { background-color: rgba(148,163,184,0.08); border-color: #334155; color: var(--color-text-secondary); }
body[data-theme="dark"] .filter-button.active,
body[data-theme="dark"] .filter-button:hover { background-color: var(--color-primary); border-color: var(--color-primary); color: #fff; box-shadow: 0 8px 16px rgba(0,0,0,0.35); }

/* Floating contact sidebar */
body[data-theme="dark"] .floating-contact-sidebar { background-color: rgba(2,6,23,0.7); border-color: #1f2937; }
body[data-theme="dark"] .contact-button { color: #e2e8f0; }
body[data-theme="dark"] .contact-button .button-text { color: #0f172a; }
/* Keep WhatsApp green even in dark mode but adapt text/icon for contrast */
body[data-theme="dark"] .contact-button--whatsapp { background-color: #22c55e; color: #052e16; }
body[data-theme="dark"] .contact-button--whatsapp i,
body[data-theme="dark"] .contact-button--whatsapp .button-text { color: #052e16; }

/* Video wrapper background */
body[data-theme="dark"] .video-wrapper { background-color: #111827; }

/* Hero section inputs keep legible contrast on dark */
body[data-theme="dark"] .hero-section input[type="text"] {
    background-color: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
}
body[data-theme="dark"] .hero-section input[type="text"]:focus {
    background-color: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.35);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.18);
}

/* Software card logo background */
/* Les logiciels utilisent désormais la même tuile que les marques; pas de fond spécifique pour l'image */

/* Footer */
body[data-theme="dark"] .footer { background-color: #0b1220; color: #cbd5e1; }
body[data-theme="dark"] .footer .text-link { color: #cbd5e1; }
body[data-theme="dark"] .footer .text-link:hover { color: var(--color-secondary); }

/* Theme toggle button styling */
.sv-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.85);
    color: #111827;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 9999px;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    font-weight: 600;
    cursor: pointer;
}
body[data-theme="dark"] .sv-theme-toggle {
    background: rgba(2,6,23,0.7);
    color: #e5e7eb;
    border-color: #334155;
}
/* Visibility control: desktop toggle visible on md+, mobile on <md */
.sv-theme-toggle--desktop { display: none; }
@media (min-width: 768px) { .sv-theme-toggle--desktop { display: inline-flex; } .sv-theme-toggle--mobile { display: none; } }

/* Keep icon readable even if text is present in the button */
.sv-theme-toggle i { font-size: 1rem; line-height: 1; margin: 0; }
/* Icon hover/focus color: moon -> black, sun -> yellow */
.sv-theme-toggle i { transition: color 0.2s ease; }
.sv-theme-toggle:hover i.fa-moon,
.sv-theme-toggle:focus-visible i.fa-moon { color: #000000; }
.sv-theme-toggle:hover i.fa-sun,
.sv-theme-toggle:focus-visible i.fa-sun { color: #facc15; /* yellow-400 */ }

/* Avoid layout shift on mobile: position the toggle absolutely inside the center group */
nav .flex-grow { position: relative; }
.sv-theme-toggle--mobile { position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
@media (max-width: 767.98px) { nav .flex-grow { padding-right: 2.75rem; } }

/* ==============================
   Badges (Logiciel / Imprimante)
   ============================== */
.sv-badge {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    padding: .35rem .55rem;
    font-size: .55rem; /* base text size */
    font-weight: 600;
    letter-spacing: .5px;
    border-radius: 9999px;
    background: linear-gradient(145deg,var(--badge-bg-start,#2563eb),var(--badge-bg-end,#1d4ed8));
    color: #fff;
    box-shadow: 0 3px 6px -1px rgba(0,0,0,.35),0 1px 2px rgba(0,0,0,.25);
    backdrop-filter: blur(4px);
    line-height: 1;
    white-space: nowrap;
}
.sv-badge i { font-size: .8rem; line-height: 1; }
/* Variante uniquement icône (non utilisée maintenant mais conservée) */
.sv-badge-icon { width: 34px; height:34px; padding:0; }
.sv-badge-icon i { font-size:15px; }
.sv-badge-with-text .sv-badge-label { line-height:1; }
.sv-badge-logiciel { --badge-bg-start:#0d9488; --badge-bg-end:#0f766e; }
.sv-badge-imprimante { --badge-bg-start:#1d4ed8; --badge-bg-end:#1e3a8a; }
body[data-theme="dark"] .sv-badge { box-shadow: 0 2px 6px rgba(0,0,0,.45); }

/* Slight larger badge on hover focus for accessibility */
.model-card-image-wrapper:hover .sv-badge,
.video-wrapper:hover .sv-badge,
.model-card-image-wrapper:focus-within .sv-badge,
.video-wrapper:focus-within .sv-badge { transform: translateY(-2px); }
/* Ensure wrappers are positioned for absolute badge */
.model-card-image-wrapper, .video-wrapper { position: relative; }
