/* =========================================================
   KLYX — design system (dark, moderne, epure)
   ========================================================= */
:root {
  --bg:        #0a0c12;
  --bg-2:      #0f121b;
  --surface:   #151926;
  --surface-2: #1b2030;
  --surface-3: #232a3d;
  --border:    #262d40;
  --border-2:  #313a52;
  --text:      #eef2f9;
  --muted:     #93a0b8;
  --muted-2:   #6b7689;
  --brand:     #7c5cff;
  --brand-2:   #9d83ff;
  --brand-ink: #ffffff;
  --accent:    #19c37d;
  --danger:    #ff5470;
  --warn:      #ffb020;
  --radius:    14px;
  --radius-sm: 10px;
  --shadow:    0 10px 30px rgba(0,0,0,.35);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.5);
  --maxw:      1280px;
  --header-h:  64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- Header ---------- */
/* Le wrapper ne doit pas creer de boite, sinon le header sticky defile avec lui */
#header-slot { display: contents; }
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,12,18,.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 18px; height: var(--header-h); }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.logo .mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center; color: #fff; font-size: 17px; font-weight: 900;
  box-shadow: 0 6px 18px rgba(124,92,255,.45);
}
.logo .mark svg { width: 17px; height: 17px; }
.search { flex: 1; max-width: 520px; position: relative; }
.search input {
  width: 100%; height: 42px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); padding: 0 16px 0 42px; font-size: 14px; outline: none;
  transition: border-color .15s, background .15s;
}
.search input:focus { border-color: var(--brand); background: var(--surface-2); }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav a.navlink { padding: 8px 12px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14px; transition: .15s; }
.nav a.navlink:hover { color: var(--text); background: var(--surface); }
.icon-btn {
  position: relative; width: 42px; height: 42px; border-radius: 11px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  display: grid; place-items: center; transition: .15s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-2); }
.icon-btn svg { width: 19px; height: 19px; }
.lang-select { height: 42px; border-radius: 11px; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); padding: 0 8px; font-size: 13px; font-weight: 700; cursor: pointer; outline: none; }
.lang-select:hover { border-color: var(--border-2); background: var(--surface-2); }
.lang-select:focus { border-color: var(--brand); }

/* ---------- RTL (arabe) ---------- */
[dir="rtl"] .search svg { left: auto; right: 14px; }
[dir="rtl"] .search input { padding: 0 42px 0 16px; }
[dir="rtl"] .cart-badge { right: auto; left: -6px; }
[dir="rtl"] .card .thumb .corner { left: auto; right: 9px; }
[dir="rtl"] .card .thumb .plat { left: auto; right: 9px; }
[dir="rtl"] .toast { border-left: none; border-right: 3px solid var(--brand); }
[dir="rtl"] .toast.ok { border-right-color: var(--accent); }
[dir="rtl"] .toast.err { border-right-color: var(--danger); }
.cart-badge {
  position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px;
  background: var(--brand); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 800;
  display: grid; place-items: center; border: 2px solid var(--bg);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 11px; border: 1px solid transparent;
  font-weight: 700; font-size: 14px; color: var(--text); background: var(--surface-2);
  transition: transform .08s, background .15s, border-color .15s; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 8px 22px rgba(124,92,255,.35); }
.btn-primary:hover { filter: brightness(1.07); background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.btn-ghost { background: transparent; border-color: var(--border-2); }
.btn-ghost:hover { background: var(--surface); }
.btn-accent { background: var(--accent); color: #042b1c; }
.btn-block { width: 100%; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Badges / tags ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 7px; }
.badge-discount { background: var(--accent); color: #042b1c; }
.badge-soft { background: var(--surface-3); color: var(--muted); }
.badge-out { background: rgba(255,84,112,.15); color: var(--danger); }
.tag { font-size: 12px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); padding: 4px 10px; border-radius: 999px; }

/* ---------- Product grid + card ---------- */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: transform .14s, border-color .14s, box-shadow .14s; position: relative;
}
.card:hover { transform: translateY(-4px); border-color: var(--border-2); box-shadow: var(--shadow); }
.card .thumb { position: relative; aspect-ratio: 600/900; background: var(--surface-2); overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .thumb img { transform: scale(1.04); }
.card .thumb .corner { position: absolute; top: 9px; left: 9px; display: flex; gap: 6px; }
.card .thumb .plat { position: absolute; bottom: 9px; left: 9px; }
.card .body { padding: 12px 13px 14px; }
.card .title { font-weight: 700; font-size: 14px; margin: 0 0 8px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.card .price-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card .price { font-weight: 800; font-size: 17px; }
.card .old { color: var(--muted-2); text-decoration: line-through; font-size: 13px; }
.card .out { color: var(--danger); font-weight: 700; font-size: 13px; }
.card-link { display: block; }

/* ---------- Sections ---------- */
.section { padding-block: 40px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 14px; }
.section-head h2 { font-size: 22px; margin: 0; }
.section-head a { color: var(--brand-2); font-weight: 700; font-size: 14px; }

/* ---------- Hero ---------- */
.hero { position: relative; margin-top: 24px; border-radius: 20px; overflow: hidden; border: 1px solid var(--border); min-height: 360px;
  background: radial-gradient(120% 140% at 80% 10%, rgba(124,92,255,.30), transparent 55%), linear-gradient(120deg, #161b2b, #0f1320); }
.hero-inner { position: relative; z-index: 2; padding: 56px 48px; max-width: 620px; }
.hero h1 { font-size: 42px; line-height: 1.05; letter-spacing: -.03em; margin-bottom: 16px; }
.hero p { color: var(--muted); font-size: 17px; margin-bottom: 26px; }
.hero .hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-art { position: absolute; right: -40px; top: 50%; transform: translateY(-50%) rotate(-6deg); z-index: 1;
  display: grid; grid-template-columns: repeat(3, 150px); gap: 16px; opacity: .9; }
.hero-art img { border-radius: 12px; box-shadow: var(--shadow-lg); aspect-ratio: 600/900; object-fit: cover; }
.hero-art img:nth-child(2) { transform: translateY(-26px); }
.hero-art img:nth-child(3) { transform: translateY(14px); }

/* ---------- Strip / categories ---------- */
.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip { padding: 8px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  font-weight: 600; font-size: 13px; transition: .15s; }
.chip:hover, .chip.active { color: #fff; border-color: var(--brand); background: var(--surface-2); }

.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 22px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; gap: 13px; align-items: flex-start; }
.feature .fic { width: 38px; height: 38px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; color: var(--brand-2); flex-shrink: 0; }
.feature .fic svg { width: 19px; height: 19px; }
.feature h4 { font-size: 14px; margin: 2px 0 3px; }
.feature p { font-size: 12.5px; color: var(--muted); margin: 0; }

/* ---------- Store layout ---------- */
.store-layout { display: grid; grid-template-columns: 250px 1fr; gap: 26px; align-items: start; padding: 28px 0 60px; }
.filters { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; position: sticky; top: calc(var(--header-h) + 16px); }
.filter-group { padding: 14px 0; border-bottom: 1px solid var(--border); }
.filter-group:first-child { padding-top: 0; }
.filter-group:last-child { border-bottom: none; padding-bottom: 0; }
.filter-group h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2); margin-bottom: 11px; }
.filter-opt { display: flex; align-items: center; gap: 9px; padding: 5px 0; color: var(--muted); font-size: 14px; cursor: pointer; }
.filter-opt:hover { color: var(--text); }
.filter-opt input { accent-color: var(--brand); width: 16px; height: 16px; }
.range-row { display: flex; gap: 8px; }
.range-row input { width: 100%; height: 38px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; color: var(--text); padding: 0 10px; font-size: 13px; outline: none; }
.store-main {}
.filters-toggle { display: none; width: 100%; align-items: center; justify-content: center; gap: 8px;
  height: 44px; background: var(--surface); border: 1px solid var(--border); border-radius: 11px;
  color: var(--text); font-weight: 700; font-size: 14px; margin: 14px 0 0; }
.filters-toggle .ft-chev { transition: transform .2s; color: var(--muted); }
.filters-toggle.open .ft-chev { transform: rotate(180deg); }
.store-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.select { height: 40px; background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 0 12px; font-size: 14px; outline: none; }
.select:focus { border-color: var(--brand); }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 34px; }
.pagination button { min-width: 40px; height: 40px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-weight: 700; }
.pagination button.active { background: var(--brand); border-color: var(--brand); }
.pagination button:disabled { opacity: .4; }

/* ---------- Product page ---------- */
.product { display: grid; grid-template-columns: 360px 1fr 320px; gap: 30px; padding: 30px 0 60px; align-items: start; }
.product .cover { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); position: sticky; top: calc(var(--header-h) + 16px); }
.product .cover img { width: 100%; aspect-ratio: 600/900; object-fit: cover; }
.product .info h1 { font-size: 30px; }
.product .meta-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0 20px; }
.product .desc { color: var(--cbd, #c4cde0); white-space: pre-line; line-height: 1.7; }
.product .desc-rest { grid-column: 1 / -1; margin-top: 6px; }
.product .desc-rest .desc { margin: 0; }
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin: 24px 0; }
.specs div { background: var(--surface); padding: 13px 16px; font-size: 13.5px; }
.specs div span { color: var(--muted); display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px; }
.buybox { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; position: sticky; top: calc(var(--header-h) + 16px); }
.buybox .price-now { font-size: 34px; font-weight: 900; letter-spacing: -.02em; }
.buybox .price-old { color: var(--muted-2); text-decoration: line-through; font-size: 16px; }
.buybox .save { color: var(--accent); font-weight: 700; font-size: 14px; }
.buybox .stockline { display: flex; align-items: center; gap: 8px; margin: 16px 0; font-size: 14px; font-weight: 600; }
.dot { width: 9px; height: 9px; border-radius: 50%; }
.dot.ok { background: var(--accent); box-shadow: 0 0 0 4px rgba(25,195,125,.15); }
.dot.no { background: var(--danger); box-shadow: 0 0 0 4px rgba(255,84,112,.15); }
.qty { display: flex; align-items: center; gap: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; width: fit-content; margin: 4px 0 16px; }
.qty button { width: 40px; height: 42px; background: var(--surface-2); border: none; color: var(--text); font-size: 18px; }
.qty span { width: 50px; text-align: center; font-weight: 700; }
.buy-reassure span { display: flex; gap: 9px; align-items: center; }
.buy-reassure svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--brand-2); }

/* ---------- Countdown / precommande ---------- */
.countdown { display: flex; gap: 8px; }
.cd-cell { flex: 1; background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 10px; padding: 10px 4px; text-align: center; }
.cd-num { font-size: 26px; font-weight: 900; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cd-lab { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2); margin-top: 2px; }
.cd-open { color: var(--accent); font-weight: 800; text-align: center; padding: 8px; }
.preorder-pill { display: inline-flex; align-items: center; gap: 6px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 800; font-size: 12px; padding: 4px 10px; border-radius: 7px; }
.edition-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 11px; cursor: pointer; margin-bottom: 8px; transition: .15s; }
.edition-opt:hover { border-color: var(--border-2); background: var(--surface-2); }
.edition-opt.sel { border-color: var(--brand); background: rgba(124,92,255,.08); }
.edition-opt .en { font-weight: 700; font-size: 14px; }
.edition-opt .ep { font-weight: 800; }
.edition-opt .er { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-2); flex-shrink: 0; }
.edition-opt.sel .er { border-color: var(--brand); background: var(--brand); box-shadow: inset 0 0 0 3px var(--surface); }

/* Banniere precommande (accueil) — identite "Vice City" rose/magenta neon */
.preorder-banner {
  --gta-pink: #ff3d9a; --gta-cyan: #1fd1e0;
  position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 26px; align-items: center;
  background:
    radial-gradient(90% 160% at 6% 0%, rgba(255,61,154,.30), transparent 55%),
    radial-gradient(80% 160% at 100% 110%, rgba(31,209,224,.18), transparent 55%),
    linear-gradient(120deg, #261134, #130c20 78%);
  border: 1px solid rgba(255,61,154,.45); border-radius: 18px; padding: 22px 26px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,61,154,.06), 0 18px 50px rgba(255,61,154,.16);
  transition: box-shadow .2s, transform .12s;
}
.preorder-banner:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(255,61,154,.12), 0 24px 60px rgba(255,61,154,.26); }
/* reflet anime qui balaie la banniere */
.preorder-banner::after { content: ''; position: absolute; top: 0; left: -60%; width: 45%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.08), transparent); transform: skewX(-18deg);
  animation: pb-shine 6s ease-in-out infinite; pointer-events: none; }
@keyframes pb-shine { 0%, 58% { left: -60%; } 100% { left: 165%; } }

.preorder-banner .pb-cover { width: 118px; aspect-ratio: 3/4; object-fit: cover; border-radius: 11px; position: relative; z-index: 2;
  box-shadow: 0 10px 30px rgba(0,0,0,.5), 0 0 0 1px rgba(255,61,154,.4), 0 0 28px rgba(255,61,154,.28); }
.preorder-banner .pb-info { position: relative; z-index: 2; }
.pb-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 900; letter-spacing: .08em;
  color: #fff; background: linear-gradient(135deg, var(--gta-pink), #ff7a3d); padding: 4px 11px; border-radius: 7px;
  box-shadow: 0 4px 14px rgba(255,61,154,.45); }
.preorder-banner .pb-info h3 { font-size: 27px; margin: 11px 0 4px; letter-spacing: -.02em; }
.preorder-banner .pb-meta { margin: 0 0 15px; color: #dcc6da; font-size: 14px; }
.pb-cta { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; color: #fff;
  background: linear-gradient(135deg, var(--gta-pink), var(--brand)); padding: 11px 20px; border-radius: 11px;
  box-shadow: 0 8px 22px rgba(255,61,154,.40); transition: filter .15s; }
.preorder-banner:hover .pb-cta { filter: brightness(1.08); }
.pb-cta svg { width: 15px; height: 15px; }
.preorder-banner .pb-right { position: relative; z-index: 2; text-align: center; }
.pb-cd-label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--gta-pink); font-weight: 800; margin-bottom: 9px; }
.preorder-banner .pb-cd { display: flex; gap: 8px; }
.preorder-banner .pb-cd .cd-cell { min-width: 60px; background: rgba(0,0,0,.4); border-color: rgba(255,61,154,.32); }
.preorder-banner .pb-cd .cd-num { color: #fff; }
.preorder-banner .pb-cd .cd-lab { color: #b98bb0; }

@media (max-width: 820px) {
  .preorder-banner { grid-template-columns: 96px 1fr; gap: 18px; }
  .preorder-banner .pb-cover { width: 96px; }
  .preorder-banner .pb-right { grid-column: 1 / -1; text-align: left; }
  .preorder-banner .pb-cd { justify-content: flex-start; }
}
@media (max-width: 480px) {
  .preorder-banner .pb-cd .cd-cell { min-width: 0; flex: 1; }
  .preorder-banner .pb-info h3 { font-size: 22px; }
}

/* ---------- Cart / checkout ---------- */
.split { display: grid; grid-template-columns: 1fr 360px; gap: 26px; align-items: start; padding: 30px 0 60px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.panel.sticky { position: sticky; top: calc(var(--header-h) + 16px); }
.cart-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.cart-item:last-child { border-bottom: none; }
.cart-item img { width: 64px; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.cart-item .ci-title { font-weight: 700; font-size: 14px; }
.cart-item .ci-sub { color: var(--muted); font-size: 12.5px; }
.summary-row { display: flex; justify-content: space-between; padding: 8px 0; color: var(--muted); font-size: 14px; }
.summary-row.total { color: var(--text); font-size: 20px; font-weight: 800; border-top: 1px solid var(--border); margin-top: 8px; padding-top: 14px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.field input, .field textarea, .field select {
  width: 100%; height: 44px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); padding: 0 14px; font-size: 14px; outline: none; transition: border-color .15s;
}
.field textarea { height: auto; padding: 12px 14px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- Checkout une page ---------- */
.checkout-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.co-h { display: flex; align-items: center; gap: 10px; font-size: 16px; margin: 0 0 14px; }
.co-num { width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-size: 13px; font-weight: 800; flex-shrink: 0; }
.paytabs { margin-bottom: 16px; }
.paytabs button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.secure-note { font-size: 11.5px; text-align: center; margin: 12px 0 0; }

/* ---------- Logos de paiement + spinner ---------- */
.pay-logos { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; justify-content: center; margin: 10px 0 2px; }
.pay-logos img { height: 26px; width: auto; display: block; border-radius: 4px; }
.stripe-spinner { width: 42px; height: 42px; border-radius: 50%; margin: 0 auto;
  border: 4px solid var(--surface-3); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Paiement crypto ---------- */
.crypto-toggle { width: 100%; display: flex; align-items: center; gap: 10px; margin-top: 18px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; color: var(--text);
  padding: 13px 16px; font-weight: 700; font-size: 14px; transition: .15s; }
.crypto-toggle:hover { border-color: var(--border-2); background: var(--surface-3); }
.crypto-toggle .ct-left { flex: 1; text-align: left; }
.crypto-toggle .ct-chev { transition: transform .2s; color: var(--muted); }
.crypto-toggle.open .ct-chev { transform: rotate(180deg); }
.crypto-pane { margin-top: 12px; padding: 16px; border: 1px solid var(--border-2); border-radius: 12px; background: var(--bg-2); }
.asset-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.asset-btn { flex: 1; min-width: 140px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 12px 14px; color: var(--text); transition: .15s; }
.asset-btn:hover { border-color: var(--border-2); }
.asset-btn.sel { border-color: var(--brand); background: rgba(124,92,255,.08); }
.asset-btn .ab-sym { font-weight: 800; font-size: 15px; }
.asset-btn .ab-net { font-size: 11px; color: var(--muted); }
.crypto-box { margin-top: 14px; }
.cb-amount { text-align: center; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 14px; }
.cb-pay { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-2); }
.cb-pay span { text-transform: none; letter-spacing: 0; }
.cb-num { font-size: 28px; font-weight: 900; letter-spacing: -.02em; margin: 4px 0; font-variant-numeric: tabular-nums; }
.cb-eur { font-size: 13px; color: var(--muted); display: flex; gap: 8px; justify-content: center; align-items: center; }
.crypto-pay-grid { display: grid; grid-template-columns: 180px 1fr; gap: 18px; align-items: start; }
.qr { background: #fff; padding: 10px; border-radius: 12px; width: 180px; height: 180px; display: grid; place-items: center; }
.qr img { width: 160px; height: 160px; display: block; }
.cb-addr label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.addr-line { display: flex; gap: 8px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.addr-line code { flex: 1; font-family: 'SF Mono', ui-monospace, monospace; font-size: 12.5px; word-break: break-all; }
@media (max-width: 520px) {
  .crypto-pay-grid { grid-template-columns: 1fr; justify-items: center; }
  .cb-addr { width: 100%; }
}

/* ---------- Key reveal ---------- */
.keybox { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--bg-2); border: 1px dashed var(--border-2); border-radius: 10px; padding: 12px 16px; margin: 8px 0; font-family: 'SF Mono', ui-monospace, monospace; font-weight: 700; letter-spacing: .04em; }
.keybox button { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 6px 12px; font-size: 12px; font-weight: 700; }

/* ---------- Auth ---------- */
.auth-wrap { max-width: 420px; margin: 60px auto; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px; }
.guest-banner { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 13px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.guest-banner a { color: var(--brand-2); font-weight: 700; }
.auth-sep { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--muted-2); font-size: 12px; }
.auth-sep::before, .auth-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-logo { display: flex; justify-content: center; margin-bottom: 16px; }
.auth-logo .mark { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 10px 26px rgba(124,92,255,.45); }
.auth-logo .mark svg { width: 36px; height: 36px; }
.tabs { display: flex; gap: 6px; background: var(--surface-2); padding: 5px; border-radius: 11px; margin-bottom: 22px; }
.tabs button { flex: 1; height: 38px; border: none; background: transparent; color: var(--muted); font-weight: 700; border-radius: 8px; }
.tabs button.active { background: var(--surface-3); color: var(--text); }

/* ---------- Admin ---------- */
.admin-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin: 22px 0 30px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.stat .v { font-size: 26px; font-weight: 900; letter-spacing: -.02em; }
.stat .l { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
table.tbl { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table.tbl th, table.tbl td { padding: 11px 14px; text-align: left; font-size: 13.5px; border-bottom: 1px solid var(--border); }
table.tbl th { color: var(--muted-2); text-transform: uppercase; font-size: 11px; letter-spacing: .05em; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tr:hover td { background: var(--surface-2); }
.thumb-sm { width: 34px; height: 48px; object-fit: cover; border-radius: 6px; }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(5,7,12,.7); backdrop-filter: blur(4px); z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-bg.show { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border-2); border-radius: 16px; padding: 26px; width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; box-shadow: var(--shadow-lg); }
.modal h3 { font-size: 20px; }
.modal .modal-close { float: right; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); width: 32px; height: 32px; border-radius: 8px; }

/* ---------- Toast ---------- */
#toasts { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--surface-3); border: 1px solid var(--border-2); border-left: 3px solid var(--brand); border-radius: 10px; padding: 13px 18px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow); animation: slidein .2s ease; min-width: 220px; }
.toast.ok { border-left-color: var(--accent); }
.toast.err { border-left-color: var(--danger); }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; background: var(--bg-2); }
.footer-inner { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 30px; padding-block: 44px 30px; }
.footer-logo { display: inline-flex; margin-bottom: 16px; }
.footer-logo .mark { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 8px 20px rgba(124,92,255,.45); }
.footer-logo .mark svg { width: 27px; height: 27px; }
.footer-inner h5 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2); margin-bottom: 14px; }
.footer-inner a { display: block; color: var(--muted); padding: 5px 0; font-size: 14px; }
.footer-inner a:hover { color: var(--text); }
.footer-bottom { border-top: 1px solid var(--border); padding-block: 18px; color: var(--muted-2); font-size: 13px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ---------- Misc / states ---------- */
.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 37%, var(--surface) 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: var(--radius); }
.card.skeleton { aspect-ratio: 600/1080; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty svg { width: 56px; height: 56px; color: var(--muted-2); margin-bottom: 14px; }
.breadcrumb { display: flex; gap: 8px; align-items: center; color: var(--muted-2); font-size: 13px; padding: 20px 0 0; }
.breadcrumb a:hover { color: var(--text); }
.stars { color: var(--warn); font-size: 13px; letter-spacing: 1px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .product { grid-template-columns: 280px 1fr; }
  .product .cover { position: static; }
  .buybox { grid-column: 1 / -1; position: static; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .admin-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-art { display: none; }
}
@media (max-width: 860px) {
  .store-layout { grid-template-columns: 1fr; }
  .filters { position: static; }
  .split { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  /* mobile-first : on garde la recherche (essentielle), on retire les liens texte */
  .nav a.navlink { display: none; }
  .header-inner { gap: 12px; }
  /* filtres repliables sur mobile pour ne pas repousser les produits */
  .filters-toggle { display: flex; }
  .filters { display: none; }
  .filters.show { display: block; margin-bottom: 14px; }
  .store-layout { padding-top: 6px; }
  /* grille fluide : +de colonnes quand l'ecran s'elargit (tablette) */
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ============ MOBILE (compact, prioritaire) ============ */
@media (max-width: 560px) {
  :root { --header-h: 54px; }
  body { font-size: 14px; }
  .container { padding: 0 16px; }

  /* Header compact */
  .logo { font-size: 17px; }
  .logo .mark { width: 26px; height: 26px; border-radius: 8px; font-size: 14px; }
  .search input { height: 38px; font-size: 13px; }
  .icon-btn { width: 38px; height: 38px; border-radius: 10px; }
  .header-inner { gap: 9px; }

  /* Hero compact */
  .hero { min-height: 0; margin-top: 14px; border-radius: 16px; }
  .hero-inner { padding: 24px 18px; max-width: none; }
  .hero h1 { font-size: 23px; line-height: 1.1; margin-bottom: 10px; }
  .hero h1 br { display: none; }
  .hero p { font-size: 13.5px; margin-bottom: 18px; }
  .hero-cta { gap: 9px; }
  .hero-cta .btn { height: 42px; flex: 1; padding: 0 12px; }

  /* Sections compactes */
  .section { padding-block: 22px; }
  /* Footer : plus d'air sur la derniere ligne */
  .footer-bottom { padding-block: 22px 40px; gap: 10px; }
  /* Toast : pleine largeur, centre, en bas sur mobile */
  #toasts { left: 12px; right: 12px; bottom: 16px; align-items: stretch; }
  .toast { min-width: 0; text-align: center; }

  /* Logo footer plus compact sur mobile + descendu un peu */
  .footer-logo { margin-top: 18px; margin-bottom: 12px; }
  .footer-logo .mark { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 6px 16px rgba(124,92,255,.35); }
  .footer-logo .mark svg { width: 23px; height: 23px; }
  .section-head { margin-bottom: 12px; }
  .section-head h2 { font-size: 18px; }
  .section-head a { font-size: 12.5px; }

  /* Features : 2 colonnes serrees */
  .features { grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 14px; }
  .feature { padding: 11px; gap: 9px; border-radius: 11px; }
  .feature .fic { width: 30px; height: 30px; border-radius: 8px; }
  .feature h4 { font-size: 12.5px; }
  .feature p { font-size: 11px; }

  /* Cartes produit compactes — grille fluide (2 colonnes sur tel, 3 vers 460px) */
  .grid { grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap: 12px; }
  .card { border-radius: 11px; }
  .card .body { padding: 8px 9px 9px; }
  .card .title { font-size: 12.5px; margin-bottom: 4px; }
  .card .price { font-size: 14.5px; }
  .card .old { font-size: 11px; }
  .card .thumb .corner { top: 6px; left: 6px; gap: 4px; }
  .card .badge { font-size: 9.5px; padding: 2px 6px; }
  .card .thumb .plat { bottom: 6px; left: 6px; }

  /* Chips genres */
  .chip { padding: 6px 12px; font-size: 12px; }

  /* Fiche produit : jaquette a gauche, titre a droite, description pleine largeur dessous */
  .product { display: block; gap: 0; padding: 16px 0 40px; }
  .product .cover { float: left; width: 108px; max-width: 108px; margin: 2px 16px 10px 0; position: static; }
  .product .info h1 { font-size: 18px; line-height: 1.25; margin: 2px 0 10px; }
  .product .info .meta-row { margin: 10px 0; gap: 7px; }
  .product .info .meta-row .tag { font-size: 11px; padding: 3px 9px; }
  .product .desc { clear: left; font-size: 13.5px; line-height: 1.75; margin: 16px 0 0; }
  .product .specs { clear: left; margin: 20px 0; }
  .specs div { padding: 10px 13px; font-size: 12px; }
  .buybox { clear: both; padding: 16px; margin-top: 6px; }
  .buybox .price-now { font-size: 26px; }
  .product .desc-rest { clear: both; margin-top: 18px; }

  /* Panneaux / panier / checkout */
  .panel { padding: 15px; }
  .split, .store-layout { padding: 14px 0 36px; gap: 14px; }
  .row2 { gap: 10px; } /* on garde 2 colonnes (CP/Ville, Exp/CVC) pour gagner de la place */
  /* Formulaires compacts sur mobile (coordonnees, etc.) */
  .field { margin-bottom: 9px; }
  .field label { margin-bottom: 4px; font-size: 12.5px; }
  .field input, .field select { height: 40px; }
  .field textarea { padding: 9px 12px; }
  .admin-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat { padding: 13px; }
  .stat .v { font-size: 21px; }
  .breadcrumb { padding-top: 12px; font-size: 12px; }
  #adminBody { overflow-x: auto; }
  table.tbl { min-width: 520px; }

  /* Banniere precommande GTA VI : compacte */
  .preorder-banner { grid-template-columns: 60px 1fr; gap: 12px; padding: 13px 14px; border-radius: 14px; }
  .preorder-banner .pb-cover { width: 60px; border-radius: 9px; }
  .pb-tag { font-size: 9px; padding: 3px 7px; letter-spacing: .05em; }
  .preorder-banner .pb-info h3 { font-size: 17px; margin: 6px 0 3px; }
  .preorder-banner .pb-meta { font-size: 11.5px; margin-bottom: 0; }
  .pb-cta { display: none; } /* toute la banniere est deja cliquable */
  .preorder-banner .pb-right { grid-column: 1 / -1; margin-top: 6px; }
  .pb-cd-label { margin-bottom: 6px; font-size: 9.5px; }
  .preorder-banner .pb-cd { gap: 6px; }
  .preorder-banner .pb-cd .cd-cell { min-width: 0; flex: 1; padding: 7px 2px; }
  .preorder-banner .pb-cd .cd-num { font-size: 18px; }
  .preorder-banner .pb-cd .cd-lab { font-size: 9px; }
}
