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

:root {
  --bg: #2c2c2c;
  --surface: #4b4a4a;
  --surface2: rgb(58, 58, 57);
  --border: #333333;
  --accent: #a05805;
  --accent-hover: #b86406;
  --success: #16a34a;
  --danger: #dc2626;
  --warn-bg: #bb9901;
  --warn-border: #ffd500;
  --warn-text: #000000d3;
  --text: #f5f5f5;
  --muted: #78716c;
  --radius: 8px;
}

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
h1 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}
.header-sub {
  font-size: 0.75rem;
  color: var(--muted);
}
#header-progress {
  font-size: 0.75rem;
  color: var(--muted);
}

.favicon {
  width: 1.8rem;
  height: 1.8rem;
  align-self: center;
} 

#main {
  display: flex;
  flex: 1;
  height: calc(100vh - 50px);
  overflow: hidden;
}

#boutonsection {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  width: 200px;
  flex-shrink: 0;
  padding: 0.75rem 0.6rem;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
  text-align: left;
  transition:
    background 0.1s,
    color 0.1s;
  position: relative;
}
.nav-btn:hover:not(:disabled) {
  background: #495361;
  color: var(--text);
}
.nav-btn.active {
  background: #495361;
  color: var(--accent);
}
.nav-btn.done {
  color: var(--success);
}
.nav-btn.done::after {
  content: "✓";
  margin-left: auto;
  font-size: 0.72rem;
}
.nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.nav-sep {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.4rem 0;
}

.btn-validate {
  color: var(--accent);
  font-weight: 600;
}
.btn-validate:hover:not(:disabled) {
  background: #495361;
}
.btn-reset:hover:not(:disabled) {
  background: #495361;
  color: var(--danger);
}

#produitcontenant {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

#pageacceuil {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  gap: 0.85rem;
  color: var(--muted);
}
.welcome-icon {
  font-size: 3rem;
}
#pageacceuil h2 {
  font-size: 1.2rem;
  color: var(--text);
  font-weight: 600;
}
#pageacceuil p {
  max-width: 440px;
  line-height: 1.6;
  font-size: 0.875rem;
}
#pageacceuil strong {
  color: var(--text);
  font-weight: 600;
}
.welcome-note {
  font-size: 0.78rem;
  color: var(--warn-text);
  background: var(--warn-bg);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid var(--warn-border);
}

#lesproduits {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

#headerproduit {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
}
#headerproduit h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.65rem;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.filter-group label {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.73rem;
  cursor: pointer;
  transition: all 0.1s;
  user-select: none;
  background: var(--surface);
}
.filter-group label:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.filter-group input[type="radio"] {
  display: none;
}
.filter-group input[type="radio"]:checked + label {
  border-color: var(--accent);
  background: #495361;
  color: var(--accent);
}

.btn-filter-reset {
  padding: 0.25rem 0.6rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 0.73rem;
  cursor: pointer;
  transition: all 0.1s;
}
.btn-filter-reset:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.compat-warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius);
  padding: 0.5rem 0.8rem;
  font-size: 0.78rem;
  color: var(--warn-text);
}

.produits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 0.65rem;
}

.unproduit {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  position: relative;
}
.unproduit:hover {
  border-color: #93c5fd;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}

.unproduit img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: var(--surface2);
}
.unproduit img.img-error {
  opacity: 0.25;
  filter: grayscale(1);
}

.unproduit .prod-info {
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}
.unproduit .prod-brand {
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.unproduit .prod-name {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}
.unproduit .prod-detail {
  font-size: 0.72rem;
  color: var(--muted);
}

.unproduit button {
  width: 100%;
  padding: 0.45rem;
  border: none;
  background: var(--surface2);
  color: var(--muted);
  font-size: 0.78rem;
  cursor: pointer;
  transition:
    background 0.1s,
    color 0.1s;
  border-top: 1px solid var(--border);
}
.unproduit button:hover {
  background: var(--accent);
  color: #fff;
}

.unproduit.selected {
  border: 1.5px solid var(--accent);
}
.unproduit.selected button {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.unproduit .sel-badge {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 99px;
}

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
  font-size: 0.875rem;
}

#pop_info {
  position: fixed;
  right: 1.25rem;
  bottom: 1.75rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.popup {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.82rem;
  opacity: 0;
  transform: translateY(-6px);
  transition:
    opacity 0.2s,
    transform 0.2s;
  max-width: 260px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.popup.show {
  opacity: 1;
  transform: translateY(0);
}
.popup.ok {
  border-left: 3px solid var(--success);
}
.popup.err {
  border-left: 3px solid var(--danger);
  color: var(--danger);
}

footer {
  border-top: 1px solid var(--border);
  padding: 0.6rem;
  text-align: center;
  background: var(--surface);
}
#copyright {
  font-size: 0.75rem;
  color: var(--muted);
}
