/* ══════════════════════════════════════════
   QLF MARKET - CUSTOM CSS
   Style premium - gris foncé/noir, grain fin, glows
   discrets, coins légèrement arrondis. Le bleu reste
   uniquement sur la zone Gaming (voir categories.njk).
   ══════════════════════════════════════════ */

/* Neutral greys ONLY. The old values here (#0c0c0e bg, #17171a cards, #9c9ca3 muted) were
   navy / slate blue-greys, which is what kept tinting the whole site blue even after the
   accent colors were swapped out. Every channel is now equal (or within 2 points). */
:root {
  --qlf-bg:      #0c0c0e;
  --qlf-card:    #17171a;
  --qlf-card-2:  #1e1e21;
  --qlf-surface: #17171a;
  --qlf-surface2:#1e1e21;
  /* DA noir / blanc / violet: le noir et le blanc portent la page, le violet est le seul
     accent. Le nom --qlf-blue est conserve parce qu'il est reference partout dans le theme. */
  --qlf-blue:    #a855f7;
  --qlf-blue-h:  #8b3fe0;
  --qlf-text:    #f5f5f7;
  --qlf-muted:   #9c9ca3;
  --qlf-border:  rgba(168,85,247,0.16);
  --qlf-border-hover: rgba(168,85,247,0.40);
  --qlf-r:       8px;
  /* Violet de l'ambiance de fond. */
  --qlf-violet:      168, 85, 247;
  --qlf-violet-deep: 109, 40, 217;
}

/* ── FOND ── */
html, body, #app, .flex-wrapper {
  background-color: var(--qlf-bg) !important;
  color: var(--qlf-text) !important;
}

/* ── AURAS GRISES (NOIR → GRIS CLAIR → NOIR) - halos radiaux doux qui dérivent lentement, défilent avec la page ──
   + FONDU À L'ARRIVÉE SUR CHAQUE PAGE - les deux animations sont combinées dans UNE seule
   déclaration `animation` (deux déclarations séparées sur le même élément s'écrasent l'une
   l'autre au lieu de s'additionner). ── */
/* ── GLOW NOIR + GRAIN, en couches de background pures sur body ──
   Tout tient dans UNE seule pile de background sur un seul élément: pas de filter, pas de
   mix-blend-mode, pas d'élément promu en couche séparée, pas de DOM en plus. C'est peint une
   fois et ça ne coûte plus rien au scroll, y compris sans accélération graphique.

   Le glow est NOIR: la base est un gris sombre légèrement relevé (le dégradé linéaire du bas de
   la pile), et les radiales noires viennent creuser dedans depuis le haut et les côtés. C'est
   cette obscurité qui "brille", pas une lueur claire. */
body {
  background-image:
    /* grain (couche du dessus) - une tuile de bruit de 180px, rasterisée une fois puis répétée */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.22'/%3E%3C/svg%3E"),
    /* glows violets - discrets, juste une ambiance colorée sur la base sombre */
    radial-gradient(1300px 660px at 50% -6%,  rgba(var(--qlf-violet), 0.20) 0%, rgba(var(--qlf-violet-deep), 0.10) 34%, rgba(var(--qlf-violet-deep), 0.035) 58%, rgba(0,0,0,0) 80%),
    radial-gradient(1000px 780px at 102% 26%, rgba(var(--qlf-violet), 0.14) 0%, rgba(var(--qlf-violet-deep), 0.06) 38%, rgba(0,0,0,0) 74%),
    radial-gradient(1000px 780px at -2% 58%,  rgba(var(--qlf-violet), 0.14) 0%, rgba(var(--qlf-violet-deep), 0.06) 38%, rgba(0,0,0,0) 74%),
    radial-gradient(1100px 700px at 50% 104%, rgba(var(--qlf-violet), 0.13) 0%, rgba(var(--qlf-violet-deep), 0.055) 40%, rgba(0,0,0,0) 78%),
    /* base gris sombre relevée, pour que le noir ait de quoi creuser */
    linear-gradient(180deg, #1b1b1e 0%, #151518 38%, #101012 72%, #0d0d0f 100%) !important;
  background-repeat: repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat !important;
  background-size: 180px 180px, auto, auto, auto, auto, auto !important;
  background-attachment: scroll !important;
  animation: qlfPageFade .4s ease !important;
}
@keyframes qlfPageFade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  body { animation: none !important; }
}

/* Grain and glow both live in the single background stack on `body` above - deliberately NOT in
   separate pseudo-elements or overlay divs. body::before used to add another absolutely
   positioned gradient layer for the top-of-page bloom; that bloom is now just the first radial in
   that stack, so the extra layer is gone. */

/* ── UTILITIES ── */
/* Le bout accentue des titres: violet + halo violet. text-shadow uniquement, donc peint une
   fois avec le texte, sans couche compositee ni filter - ca reste fluide sans acceleration
   graphique, contrairement aux blur/mix-blend-mode qu'on avait retires. */
.qlf-glow, .qlf-blue-glow, .qlf-section-title .qlf-accent, .qlf-accent {
  color: var(--qlf-blue);
  text-shadow: 0 0 16px rgba(var(--qlf-violet), 0.55), 0 0 38px rgba(var(--qlf-violet), 0.26);
}
.qlf-container { max-width: 1400px; margin: 0 auto; padding: 0 2rem; }
.qlf-section-head { text-align: center; margin-bottom: 3rem; }
.qlf-section-title { font-size: clamp(1.8rem,3.5vw,2.8rem); font-weight: 900; letter-spacing: -0.02em; color: var(--qlf-text); margin: 0 0 0.75rem; text-transform: uppercase; }
.qlf-section-sub { color: var(--qlf-muted); font-size: 1rem; margin: 0; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--qlf-bg); }
::-webkit-scrollbar-thumb { background: rgba(var(--qlf-violet), 0.35); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(var(--qlf-violet), 0.55); }

/* ── SELECTION ── */
::selection { background: rgba(var(--qlf-violet), 0.35); color: #fff; }

/* ── LIENS ── */
a { color: var(--qlf-blue); }
a:hover { color: var(--qlf-blue-h); }

/* ── COINS ARRONDIS COHÉRENTS (à la solar) - appliqué à tous les composants natifs Bootstrap ── */
.btn, .card, .modal-content, .form-control, .form-select,
.dropdown-menu, .alert, .page-link, .badge:not(.rounded-pill),
.accordion-item, .toast, .input-group, input, select, textarea {
  border-radius: var(--qlf-r) !important;
}

/* ── BOUTONS ── */
.btn-primary { background: var(--qlf-blue) !important; border-color: var(--qlf-blue) !important; }
.btn-primary:hover { background: var(--qlf-blue-h) !important; border-color: var(--qlf-blue-h) !important; }
.btn-outline-primary { color: var(--qlf-blue) !important; border-color: var(--qlf-blue) !important; }
.btn-outline-primary:hover { background: var(--qlf-blue) !important; color: #fff !important; }

/* ── SURVOL: contour violet sur tout ce qui se clique ──
   Le box-shadow "0 0 0 1px" fait le contour (il suit le border-radius, contrairement a outline)
   et la seconde ombre pose un halo discret. !important parce que les composants declarent leurs
   propres :hover dans leur <style>, charge apres ce fichier. */
.btn, button, [role="button"], .qlf-viewall-btn, .qlf-nav-pill {
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover, .btn:focus-visible,
button:hover, button:focus-visible,
[role="button"]:hover,
.qlf-viewall-btn:hover, .qlf-nav-pill:hover {
  border-color: var(--qlf-blue) !important;
  box-shadow: 0 0 0 1px rgba(var(--qlf-violet), 0.55), 0 0 18px rgba(var(--qlf-violet), 0.26) !important;
}

/* ── CARDS GÉNÉRALES ── */
.card { background: var(--qlf-surface) !important; border-color: var(--qlf-border) !important; color: var(--qlf-text) !important; }
.card-body { background: transparent !important; }

/* ── MODALS ── */
.modal-content { background: var(--qlf-surface) !important; border: 1px solid var(--qlf-border) !important; }
.modal-header { border-bottom-color: var(--qlf-border) !important; }
.modal-footer { border-top-color: var(--qlf-border) !important; }
.btn-close { filter: invert(1) !important; }

/* ── INPUTS / FORMS ── */
.form-control, .form-select {
  background: var(--qlf-surface2) !important;
  border-color: var(--qlf-border) !important;
  color: var(--qlf-text) !important;
}
.form-control:focus, .form-select:focus {
  border-color: var(--qlf-blue) !important;
  box-shadow: 0 0 0 3px rgba(var(--qlf-violet), 0.20) !important;
}
.form-control::placeholder { color: var(--qlf-muted) !important; }

/* ── TABLES ── */
.table { color: var(--qlf-text) !important; }
.table thead th { border-bottom: 2px solid var(--qlf-border) !important; color: var(--qlf-muted) !important; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
.table tbody tr:hover { background: rgba(255,255,255,0.03) !important; }
.table-bordered > :not(caption) > * > * { border-color: var(--qlf-border) !important; }

/* ── ALERTS ── */
.alert-info { background: rgba(150,150,158,0.1) !important; border-color: rgba(150,150,158,0.25) !important; color: #d4d4d8 !important; }
.alert-success { background: rgba(34,197,94,0.1) !important; border-color: rgba(34,197,94,0.25) !important; color: #86efac !important; }
.alert-danger { background: rgba(239,68,68,0.1) !important; border-color: rgba(239,68,68,0.25) !important; color: #fca5a5 !important; }
.alert-warning { background: rgba(245,158,11,0.1) !important; border-color: rgba(245,158,11,0.25) !important; color: #fde68a !important; }

/* ── PAGINATION ── */
.page-link { background: var(--qlf-surface) !important; border-color: var(--qlf-border) !important; color: var(--qlf-text) !important; }
.page-link:hover { background: rgba(255,255,255,0.06) !important; color: var(--qlf-blue) !important; }
.page-item.active .page-link { background: var(--qlf-blue) !important; border-color: var(--qlf-blue) !important; }

/* ── BADGES ── */
.badge.bg-secondary { background: rgba(255,255,255,0.1) !important; }

/* ── NAV TABS ── */
.nav-tabs { border-bottom-color: var(--qlf-border) !important; }
.nav-tabs .nav-link { color: var(--qlf-muted) !important; }
.nav-tabs .nav-link.active { color: var(--qlf-blue) !important; border-color: var(--qlf-blue) !important; background: transparent !important; }

/* ── SUPPRESSION PILLS VARIANTES (solar, Day, 12 Months, etc.) ──
   SellAuth utilise bg-dark, rounded-pill, ou styles inline       */
.modal .card .badge.bg-dark,
.modal .card .badge.bg-secondary,
.modal .card .badge.rounded-pill:not(.bg-success):not(.bg-primary):not(.bg-danger):not(.bg-warning):not(.bg-info),
.modal .card [style*="position: absolute"],
.modal .card [style*="position:absolute"],
.modal .card .position-absolute,
.modal .card .card-img-overlay,
.modal .card .details-top-overlay { display: none !important; visibility: hidden !important; }




/* ══════════════════════════════════════════
   TOUS ÉCRANS - bloque le scroll horizontal fantôme
   Cause identifiée : le carousel d'avis (feedbacks.njk) positionne
   TOUS les avis (pas seulement les voisins visibles) via translateX
   à l'intérieur d'un conteneur en overflow:visible - plus il y a
   d'avis, plus la page "s'étend" vers la droite/gauche avec une zone
   fantôme scrollable (invisible, opacity:0, mais toujours dans le flux).
   D'abord corrigé mobile-only, mais le même souci existe aussi sur
   desktop (rien n'empêchait la page de s'étendre sur un grand écran non
   plus) - ce filet de sécurité s'applique donc maintenant partout. Il ne
   change rien visuellement (le carousel garde son effet d'aperçu des
   cartes voisines, qui lui tient dans la largeur visible). */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}
img, svg, video, iframe, canvas {
  max-width: 100%;
}

/* Le fondu d'arrivée (qlfPageFade) reste sur tous les écrans ; la dérive infinie des halos
   (qlfAuraDrift, 46s en boucle sur TOUTES les pages) est coupée partout, pas juste sur mobile -
   sans accélération graphique (vieille machine, navigateur bridé, rendu logiciel), une animation
   `background-position` en continu force un recalcul CPU à chaque frame au lieu de passer par le
   compositeur GPU, ce qui rend la page saccadée. Le halo reste visible, juste figé. */
body { animation: qlfPageFade .4s ease !important; }

/* ══════════════════════════════════════════
   MODAL PRODUITS - scroll HORIZONTAL
   ══════════════════════════════════════════ */
.qlf-group-modal .modal-body,
.gp-modal .modal-body {
  scroll-behavior: auto;
  max-height: none !important;
  overflow-y: hidden !important;
  overflow-x: auto;
  padding-bottom: 1.25rem !important;
}
.qlf-group-modal .modal-dialog,
.gp-modal .modal-dialog { max-height: none; }
.qlf-group-modal .modal-content,
.gp-modal .modal-content { max-height: 85vh; }

/* Row devient une piste horizontale */
.qlf-group-modal .modal-body .row,
.gp-modal .modal-body .row {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 1rem;
  margin: 0 !important;
}
.qlf-group-modal .modal-body .row > div,
.gp-modal .modal-body .row > div {
  flex: 0 0 240px !important;
  max-width: 240px !important;
  padding: 0 !important;
}

/* Scrollbar horizontale stylée */
.qlf-group-modal .modal-body::-webkit-scrollbar,
.gp-modal .modal-body::-webkit-scrollbar { height: 8px; width: 8px; }
.qlf-group-modal .modal-body::-webkit-scrollbar-track,
.gp-modal .modal-body::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); border-radius: 8px; }
.qlf-group-modal .modal-body::-webkit-scrollbar-thumb,
.gp-modal .modal-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 8px; }
.qlf-group-modal .modal-body::-webkit-scrollbar-thumb:hover,
.gp-modal .modal-body::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

/* ══════════════════════════════════════════
   MOBILE / TABLETTE

   Ce bloc est volontairement en dernier : les composants du theme
   declarent leurs styles dans des <style> inline, charges APRES ce
   fichier. A specificite egale c'est le dernier qui gagne, donc les
   regles ci-dessous montent la specificite (ou passent en !important)
   pour reprendre la main sur mobile uniquement. Rien ici ne s'applique
   au-dessus de 900px.
   ══════════════════════════════════════════ */

/* ── Le pouce a besoin de place : Apple recommande 44px, on ne descend
      jamais sous 40px sur ce qui se clique. ── */

@media (max-width: 900px) {
  /* Le libelle "Join discord / 198 online - 2296 members" fait a lui seul
     160px de large. L'icone suffit tant qu'on a la place. */
  .qlf-navbar .qlf-discord-pill .qlf-discord-label { display: none !important; }
  .qlf-navbar .qlf-discord-pill { padding: 0.45rem 0.6rem !important; }
}

@media (max-width: 600px) {
  /* ══ BARRE DU HAUT ══
     Probleme corrige ici : .qlf-nav-actions mesurait 584px dans un ecran
     de 375px. Combine au `overflow-x: hidden` du body, tout ce qui suit
     le logo etait purement invisible - panier, connexion, et meme le
     bouton burger (qui commencait a x=741). Autrement dit : aucun menu
     et aucun acces au compte depuis un telephone.

     La barre ne garde donc que l'essentiel : logo, panier, compte, menu.
     Discord, les tickets et le choix de la devise sont repris dans le menu
     burger (voir components/navbar.njk) - rien n'est perdu. */
  .qlf-navbar .qlf-nav-inner {
    gap: 0.5rem !important;
    padding: 0 0.75rem !important;
  }
  /* Logo : l'icone seule. Le nom "QLF MARKET" prenait ~120px pour une
     information que l'icone donne deja ; il est repris en tete du menu
     burger (voir components/navbar.njk). */
  .qlf-navbar .qlf-nav-logo { flex-shrink: 0; }
  .qlf-navbar .qlf-nav-logo-text { display: none !important; }
  .qlf-navbar .qlf-nav-logo-img { height: 32px !important; }

  .qlf-navbar .qlf-nav-actions {
    flex: 1 1 auto !important;
    min-width: 0;
    justify-content: flex-end;
    gap: 0.35rem !important;
  }
  .qlf-navbar .qlf-nav-actions .qlf-discord-pill,
  .qlf-navbar .qlf-nav-actions .qlf-ticket-btn,
  .qlf-navbar .qlf-nav-actions .qlf-currency-wrap { display: none !important; }

  /* "Login" / "Dashboard" garde son libelle : la place liberee par le logo
     le permet, et un bouton ecrit se comprend mieux qu'une icone seule pour
     l'action la plus importante de la barre. */
  .qlf-navbar .qlf-nav-actions .qlf-pill-primary {
    height: 40px;
    padding: 0 0.8rem !important;
    white-space: nowrap;
  }

  .qlf-navbar .qlf-nav-actions .qlf-icon-btn { width: 40px !important; height: 40px !important; }
  .qlf-navbar .qlf-nav-burger { width: 40px !important; height: 40px !important; }

  /* Le menu burger lui-meme (contenu, icones, hauteur des liens, devise)
     est stylise dans components/navbar.njk, avec le reste de la navbar -
     un seul endroit a modifier plutot que deux. */
  .qlf-navbar .qlf-nav-mobile { padding: 0.5rem 0.75rem 1rem !important; }

  /* ══ CHAMPS DE SAISIE ══
     Sous 16px, Safari iOS zoome automatiquement sur le champ des qu'on
     le touche, et la page reste zoomee. Le site paraissait "casse" a
     cause de ca. 16px = plus de zoom force. */
  input, select, textarea,
  .form-control, .form-select {
    font-size: 16px !important;
  }

  /* ══ FICHE PRODUIT ══
     Les marges s'empilaient : 12 + 16 + 20 + 12 = 60px de chaque cote,
     soit un tiers de l'ecran perdu. On les resserre sur mobile. */
  .qlf-pp .container.px-3 { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
  .qlf-pp-fold-card { padding-left: 0.875rem !important; padding-right: 0.875rem !important; }
  .qlf-pp .row.gx-6 { --bs-gutter-x: 0.5rem !important; }

  /* Les variantes (DAY / 3 DAYS / WEEK / MONTH) etaient sur une seule
     ligne en defilement horizontal : la derniere sortait de l'ecran et
     rien n'indiquait qu'on pouvait faire glisser. Elles passent a la
     ligne, toutes visibles d'un coup.

     La classe est repetee (.variants.variants) uniquement pour gagner un
     cran de specificite : le composant declare
     `.product-form .variants` avec flex-wrap nowrap !important dans un
     <style> charge apres ce fichier, donc a specificite egale il gagnait.

     Les boutons gardent leur largeur fixe : les etirer ferait un bouton
     pleine largeur sur la derniere ligne quand elle n'en contient qu'un. */
  .product-form .variants.variants,
  .variants.variants {
    flex-wrap: wrap !important;
    overflow-x: visible !important;
  }

  /* ══ ZONES CLIQUABLES TROP PETITES ══ */
  .gp-alpha-btn { min-height: 40px !important; min-width: 40px !important; }
  .qlf-footer-link { min-height: 40px; display: flex; align-items: center; }
  .qlf-rev-see-all { min-height: 40px; display: inline-flex; align-items: center; }

  /* ══ LISIBILITE ══
     Plusieurs libelles tombaient a 10.9px, illisibles sur un telephone. */
  .qlf-pipe-num, .qlf-loyalty-mini-lbl { font-size: 0.75rem !important; }
  .qlf-rc-date { font-size: 0.78rem !important; }

  /* Titres de section : evite les coupures de mots hasardeuses. */
  .qlf-section-title { font-size: clamp(1.35rem, 6.5vw, 1.9rem) !important; }
  .qlf-container { padding: 0 1rem !important; }
}

/* Ecrans etroits (360px et moins) : le logo se resserre encore un peu. */
@media (max-width: 380px) {
  .qlf-navbar .qlf-nav-logo-text { font-size: 0.85rem !important; }
}
