/* ==========================================================================
   TechSavy — Design Tokens unifiés (réf. ERP / CPQ)
   Toutes les pages du site partagent ces variables.
   ========================================================================== */

:root {
  /* Brand accent */
  --accent: #3B82F6;
  --accent-hover: #2563EB;
  --accent-soft: #60A5FA;
  --accent-bg-soft: #031E49;
  --accent-text-soft: #C5DAFC;

  /* Surfaces (du plus sombre au plus clair) */
  --bg-base: #0F1623;
  --bg-surface: #161A22;
  --bg-card: #192134;
  --bg-card-2: #1D212B;

  /* Borders / dividers */
  --border: #283652;
  --border-strong: #303746;

  /* Texte */
  --text-main: #F8F9FC;
  --text-muted: #B5C0D9;
  --text-subtle: #64748B;

  /* États */
  --error: #EF4444;
  --success: #22C55E;
}

/* ==========================================================================
   Reset & base typography
   ========================================================================== */

* {
  transition: color .2s ease, background-color .2s ease, border-color .2s ease, opacity .2s ease, transform .2s ease;
}

body {
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-base);
  color: var(--text-muted);
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Plus Jakarta Sans", "DM Sans", ui-sans-serif, system-ui, sans-serif;
  color: var(--text-main);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Tailles de repli pour les titres SANS classe Tailwind text-* (les classes text-* restent prioritaires) */
h1 { font-size: clamp(2rem, 5vw, 3.75rem); line-height: 1.1; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); line-height: 1.2; }
h3 { font-size: 1.25rem; line-height: 1.3; }

p { line-height: 1.6; }

/* ==========================================================================
   Menu déroulant « Products » (multi-produits)
   ========================================================================== */
.ts-dropdown { position: relative; display: inline-block; }
.ts-dropdown-btn {
  background: none; border: none; cursor: pointer; font: inherit;
  display: inline-flex; align-items: center;
}
.ts-dropdown-menu {
  position: absolute; top: 100%; left: 0; margin-top: 0.6rem;
  background: var(--bg-card, #192134);
  border: 1px solid var(--border, #283652);
  border-radius: 12px; padding: 0.5rem; min-width: 300px;
  box-shadow: 0 16px 40px -8px rgba(0,0,0,0.5);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 70;
}
.ts-dropdown:hover .ts-dropdown-menu,
.ts-dropdown.open .ts-dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.ts-dropdown-menu a {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0.7rem; border-radius: 8px; text-decoration: none;
  color: var(--text-main, #F8F9FC);
}
.ts-dropdown-menu a:hover { background: rgba(59, 130, 246, 0.10); }
.ts-dropdown-menu .ts-dd-ic { font-size: 1.3rem; line-height: 1; }
.ts-dropdown-menu .ts-dd-txt strong { display: block; font-size: 0.9rem; font-weight: 700; }
.ts-dropdown-menu .ts-dd-txt em { display: block; font-style: normal; font-size: 0.78rem; color: var(--text-muted, #B5C0D9); margin-top: 1px; }

/* ==========================================================================
   Header unifié
   ========================================================================== */

.ts-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
  background: rgba(15, 22, 35, 0.85);
  border-bottom: 1px solid var(--border);
}
.ts-nav-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4rem;
}
.ts-nav-logo { height: 2rem; width: auto; }
.ts-nav-links {
  display: none;
  gap: 2rem;
  align-items: center;
}
@media (min-width: 768px) {
  .ts-nav-links { display: flex; }
}
.ts-nav-link {
  color: var(--text-muted);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
}
.ts-nav-link:hover, .ts-nav-link.active { color: var(--text-main); }
.ts-nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.ts-lang-toggle {
  display: none;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: .25rem .75rem;
  font-size: .75rem;
  font-weight: 500;
}
@media (min-width: 640px) {
  .ts-lang-toggle { display: inline-flex; }
}
.ts-lang-toggle .active { color: var(--text-main); }
.ts-lang-toggle .inactive { color: var(--text-muted); }
.ts-lang-toggle .sep { margin: 0 .5rem; color: var(--border); }

.ts-signin {
  display: none;
  color: var(--text-main);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
}
@media (min-width: 640px) { .ts-signin { display: inline-block; } }

.ts-btn-primary {
  background: var(--accent);
  color: #FFFFFF;
  padding: .5rem 1.25rem;
  border-radius: .5rem;
  font-size: .875rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(59, 130, 246, .25);
}
.ts-btn-primary:hover { background: var(--accent-hover); }

.ts-btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: .5rem 1.25rem;
  border-radius: .5rem;
  font-size: .875rem;
  font-weight: 700;
  cursor: pointer;
}
.ts-btn-secondary:hover { background: rgba(59, 130, 246, .1); }

.ts-mobile-menu-btn {
  color: var(--text-main);
  background: none;
  border: none;
  cursor: pointer;
}
@media (min-width: 768px) { .ts-mobile-menu-btn { display: none; } }

/* ==========================================================================
   Footer unifié (4 colonnes)
   ========================================================================== */

.ts-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 5rem 1rem 2.5rem;
}
.ts-footer-inner {
  max-width: 80rem;
  margin: 0 auto;
}
.ts-footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  margin-bottom: 4rem;
}
@media (min-width: 768px) { .ts-footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .ts-footer-grid { grid-template-columns: repeat(4, 1fr) auto; } }
.ts-footer-badge-col { justify-self: start; }

.ts-footer-brand img { height: 2rem; margin-bottom: 1.5rem; }
.ts-footer-brand p {
  color: var(--text-subtle);
  font-size: .875rem;
  margin-bottom: 1.5rem;
  max-width: 18rem;
}
.ts-footer-social { display: flex; gap: 1rem; }
.ts-footer-social a {
  color: var(--text-subtle);
  width: 1.25rem;
  height: 1.25rem;
  display: inline-flex;
}
.ts-footer-social a:hover { color: var(--text-main); }
.ts-footer-social img { width: 1.25rem; height: 1.25rem; }

.ts-footer-badge {
  display: inline-block;
  background: #F1F3F6;
  padding: 10px 12px;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.06);
  transition: transform .18s ease, box-shadow .18s ease;
}
.ts-footer-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.1);
}
.ts-footer-badge img { width: 110px; height: auto; display: block; border-radius: 4px; }

.ts-footer-col h4 {
  color: #FFFFFF;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}
.ts-footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.ts-footer-col a {
  color: var(--text-subtle);
  font-size: .875rem;
  text-decoration: none;
}
.ts-footer-col a:hover { color: var(--text-main); }

.ts-footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}
@media (min-width: 640px) {
  .ts-footer-bottom { flex-direction: row; justify-content: space-between; }
}
.ts-footer-bottom p,
.ts-footer-bottom span {
  color: var(--text-subtle);
  font-size: .75rem;
}
.ts-footer-trust { display: flex; align-items: center; gap: .5rem; }

/* Footer minimal (checkout) */
.ts-footer-minimal {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 1.5rem 1rem;
  text-align: center;
}
.ts-footer-minimal p {
  color: var(--text-subtle);
  font-size: .75rem;
  margin: 0;
}
.ts-footer-minimal a {
  color: var(--text-subtle);
  text-decoration: none;
  margin: 0 .5rem;
}
.ts-footer-minimal a:hover { color: var(--text-main); }

/* ==========================================================================
   Utilitaires
   ========================================================================== */

.glass-card {
  background: rgba(30, 41, 59, 0.5);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.text-gradient {
  background: linear-gradient(to bottom right, #ffffff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }
