/* =========================================================
   THEME
   ========================================================= */
:root{
  --bg:#0b0f14;
  --surface:#111826;
  --surface-2:rgba(255,255,255,.03);

  --text:#e8eef7;
  --muted:#a9b4c4;

  --border:rgba(255,255,255,.10);
  --shadow: 0 10px 30px rgba(0,0,0,.35);

  --accent:#4aa3ff;
  --radius:18px;
}

/* =========================================================
   BASE
   ========================================================= */
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial;
  background:var(--bg);
  color:var(--text);
  line-height:1.5;
}
a{color:inherit;text-decoration:none}
.container{max-width:1100px;margin:0 auto;padding:24px}
.small{color:var(--muted);font-size:.92rem}

/* =========================================================
   HEADER / NAV
   ========================================================= */
.header{
  position:sticky; top:0; z-index:10;
  background:rgba(11,15,20,.85);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--border);
}
.nav{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}

/* Brand */
.brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:240px;
}
.brand-logo-wide{
  height:54px;          /* ajuste ici : 48 / 54 / 60 */
  width:auto;
  display:block;
}
.brand-title{
  display:flex;
  flex-direction:column;
  line-height:1.1;
}
.brand-title span{
  font-size:.9rem;
  color:var(--muted);
}

/* Menu */
.menu{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.menu a{
  padding:10px 12px;
  border-radius:999px;
  border:1px solid transparent;
  color:var(--muted);
  background:transparent;
}
.menu a:hover{
  border-color:var(--border);
  color:var(--text);
}
.menu a.active{
  color:var(--text);
  border-color:rgba(74,163,255,.35);
  background:rgba(74,163,255,.10);
}

/* =========================================================
   HERO
   ========================================================= */
.hero{
  margin-top:22px;
  padding:26px;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:
    radial-gradient(1200px 500px at 10% 0%, rgba(74,163,255,.18), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(120,255,196,.10), transparent 55%),
    var(--surface);
  box-shadow:var(--shadow);
}
.hero h1{
  margin:0 0 10px 0;
  font-size:1.9rem;
  letter-spacing:-.02em;
}
.hero p{margin:0;color:var(--muted);max-width:75ch}
.hero .cta{
  margin-top:16px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:11px 14px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.04);
  color:var(--text);
}
.btn.primary{
  border-color:rgba(74,163,255,.35);
  background:rgba(74,163,255,.12);
}
.btn:hover{transform:translateY(-1px)}
.btn:active{transform:translateY(0)}

/* =========================================================
   GRID / CARDS
   ========================================================= */
.grid{
  display:grid;
  grid-template-columns:repeat(12,1fr);
  gap:16px;
  margin-top:18px;
}
.card{
  grid-column: span 6;
  padding:18px;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:var(--surface-2);
  box-shadow:var(--shadow);
}
.card h2{margin:0 0 6px 0;font-size:1.15rem}
.card p{margin:0;color:var(--muted)}

@media (max-width: 900px){
  .card{grid-column: span 12;}
}

/* =========================================================
   TABLES / BADGES
   ========================================================= */
.section-title{
  margin:28px 0 10px 0;
  font-size:1.25rem;
  letter-spacing:-.01em;
}
.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
  border-radius:16px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.02);
  box-shadow:var(--shadow);
}
.table th,.table td{
  padding:12px 12px;
  border-bottom:1px solid var(--border);
  text-align:left;
}
.table th{
  color:var(--muted);
  font-weight:650;
  background:rgba(255,255,255,.03);
}
.table tr:last-child td{border-bottom:none}

.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:5px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  color:var(--muted);
  font-size:.86rem;
  background:rgba(255,255,255,.02);
}

/* Badges couleur (Occasions dispo) */
.badge.ok{
  border-color: rgba(22,163,74,.35);
  background: rgba(22,163,74,.10);
  color:#d8ffe8;
}
.badge.warn{
  border-color: rgba(245,158,11,.35);
  background: rgba(245,158,11,.12);
  color:#fff1d6;
}
.badge.no{
  border-color: rgba(239,68,68,.35);
  background: rgba(239,68,68,.12);
  color:#ffd7d7;
}

/* =========================================================
   OCCASIONS (cartes)
   ========================================================= */
.card-announce{ padding:16px; }
.announce-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}
.announce-img{
  width:100%;
  height:180px;
  margin-top:12px;
  border-radius:14px;
  border:1px solid var(--border);
  object-fit:cover;
  display:block;
}
.announce-meta{
  margin-top:10px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

/* =========================================================
   FOOTER + SOCIAL
   ========================================================= */
.footer{
  margin-top:32px;
  padding:20px 0;
  border-top:1px solid var(--border);
  color:var(--muted);
  font-size:.92rem;
}

.footer-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
}

.footer-right{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}

.footer-label{
  color:var(--muted);
  font-size:.92rem;
}

/* Mail en texte */
.footer-mail{
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-mail:hover{ color: var(--accent); }

.footer-sep{
  color: var(--muted);
  margin: 0 6px;
}

/* Réseaux */
.social{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.social-link{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:9px 12px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.02);
  color:var(--muted);
}
.social-link:hover{
  color:var(--text);
  border-color:rgba(74,163,255,.35);
  background:rgba(74,163,255,.10);
}
.social-link svg{
  width:18px;
  height:18px;
  fill:currentColor;
  display:block;
}

/* =========================================================
   BANDEAU MODELES
   ========================================================= */
.models-strip{ margin-top:18px; }

.models-row{
  display:flex;
  gap:12px;
  overflow:auto;
  padding:10px;
  border:1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.02);
  box-shadow: var(--shadow);
  scroll-snap-type: x mandatory;
}

.models-row img{
  height:110px;          /* ajuste ici : 100 / 110 / 120 */
  width:auto;
  max-width:220px;
  border-radius:12px;
  border:1px solid var(--border);
  display:block;
  object-fit:cover;
  scroll-snap-align:start;
  cursor: zoom-in;
}

.models-row img:hover{
  transform: translateY(-1px);
  transition: transform .12s ease;
}

/* =========================================================
   MODAL ZOOM IMAGES
   ========================================================= */
.img-modal{
  position:fixed;
  inset:0;
  display:none;
  z-index:9999;
}
.img-modal.is-open{ display:block; }

.img-modal-backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.7);
}

.img-modal-content{
  position:relative;
  max-width:min(92vw, 1100px);
  max-height:88vh;
  margin: 6vh auto 0;
  padding: 10px;
  border-radius: 16px;
  border:1px solid var(--border);
  background: rgba(17,24,38,.95);
  box-shadow: var(--shadow);
}

.img-modal-content img{
  width:100%;
  height:auto;
  max-height: calc(88vh - 20px);
  object-fit: contain;
  display:block;
  border-radius: 12px;
}

.img-modal-close{
  position:absolute;
  top:8px;
  right:10px;
  width:36px;
  height:36px;
  border-radius: 12px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor:pointer;
}
.img-modal-close:hover{
  background: rgba(74,163,255,.14);
}

/* =========================================================
   RESPONSIVE (mobile)
   ========================================================= */
@media (max-width: 600px){
  .brand{min-width:unset}
  .brand-logo-wide{height:40px}
  .brand-title{display:none}           /* enlève le texte sous logo */
  .social-link span{display:none}      /* n’affiche que les icônes */
  .footer-row{justify-content:center}
  .footer-right{width:100%;justify-content:center}
}

/* Formulaire devis */
.form-card{
  margin-top:18px;
  padding:18px;
  border:1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.02);
  box-shadow: var(--shadow);
}

.form-grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:14px;
  margin-top:12px;
}

.field{ grid-column: span 6; display:flex; flex-direction:column; gap:6px; }
.field-full{ grid-column: span 12; }

.field label{ color: var(--muted); font-size:.92rem; }

.field input,
.field select,
.field textarea{
  padding:12px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
  color: var(--text);
  outline:none;
}

.field input:focus,
.field select:focus,
.field textarea:focus{
  border-color: rgba(74,163,255,.45);
  box-shadow: 0 0 0 3px rgba(74,163,255,.12);
}

.form-alert{
  margin-top:16px;
  padding:12px 14px;
  border-radius: 14px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.02);
}

.form-alert.ok{
  border-color: rgba(22,163,74,.35);
  background: rgba(22,163,74,.10);
  color:#d8ffe8;
}
.form-alert.warn{
  border-color: rgba(245,158,11,.35);
  background: rgba(245,158,11,.12);
  color:#fff1d6;
}

.form-errors{ margin:10px 0 0 18px; }

@media (max-width: 900px){
  .field{ grid-column: span 12; }
}

/* Fix visibilité des options (select) en dark */
.field select{
  color: var(--text);
  background: rgba(255,255,255,.03);
}

.field select option,
.field select optgroup{
  background-color: #111826;  /* fond sombre */
  color: #e8eef7;             /* texte clair */
}
/* Firmwares - boutons filtre (Reset gauche / Appliquer droite) */
.actions-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-top:12px;
}

.actions-row .btn{
  flex: 1;
  text-align: center;
}

/* =========================
   Firmwares Marlin - Layout
   ========================= */

.fw-filters{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
  margin-bottom:16px;
}
.fw-filters .span-2{ grid-column: 1 / -1; }

.fw-actions{
  display:flex;
  justify-content:space-between;
  gap:12px;
}
.fw-actions .btn{
  flex:1;
  text-align:center;
}

/* Catalogue + checklist */
.fw-layout{
  display:grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap:16px;
  align-items:start;
}

@media (max-width: 900px){
  .fw-filters{ grid-template-columns: 1fr; }
  .fw-filters .span-2{ grid-column:auto; }
  .fw-layout{ grid-template-columns: 1fr; }
}

/* Liste */
.fw-list{ display:grid; gap:12px; }

.fw-card-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
}
.fw-title{
  margin:0 0 6px 0;
  font-size:1.05rem;
}
.fw-meta{
  display:flex;
  flex-wrap:wrap;
  gap:10px 14px;
  opacity:.95;
}
.fw-meta span{ white-space:nowrap; }

.fw-tags{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
}
.tag{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.04);
  font-size:.85rem;
}

.fw-checklist{ display:grid; gap:12px; }
.fw-h3{ margin:0 0 8px 0; font-size:1rem; }

/* =========================
   Firmwares - filtres + boutons
   ========================= */

.filters .field label{
  display:block;
  font-size:.9rem;
  opacity:.9;
  margin: 0 0 6px 0;
}

.filters input,
.filters select{
  width:100%;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: inherit;
  outline: none;
}

.filters input::placeholder{ opacity:.65; }

.filters-grid{
  display:grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap:12px;
}

@media (max-width: 900px){
  .filters-grid{ grid-template-columns: 1fr; }
}

.btn-row{
  margin-top:12px;
  display:flex;
  gap:12px;
}

.btn-row .btn{
  flex:1;
  text-align:center;
  justify-content:center;
}

/* Variantes de boutons si besoin */
.btn.btn-primary{
  border:1px solid rgba(120,210,255,.35);
  background: rgba(60,170,255,.18);
}

.btn.btn-ghost{
  border:1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
}

/* Carte firmware (juste pour respirer) */
.firmware-card h3{
  font-size: 1.05rem;
}

/* Grille des cartes firmwares */
.grid.firmwares-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 900px){
  .grid.firmwares-grid{
    grid-template-columns: 1fr;
  }
}

/* Boutons Appliquer/Reset un peu moins hauts */
.btn-row .btn{
  padding: 10px 14px;
  border-radius: 14px;
}

.sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}
