:root {
  --red: #ff3b30;
  --orange: #ff8c42;
  --accent: linear-gradient(90deg, #ff8c42, #ff3b30);
  --white: #fff;
  --bg: #fff7f6;
  --text-color: #222;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  --glass: rgba(255,255,255,0.06);
  --header-bg: linear-gradient(90deg, var(--red), var(--orange));
  --btn-bg: linear-gradient(90deg, var(--red), var(--orange));
  --price-color: var(--red);
  --price-icon-color: var(--orange);
  --discord-bg: #2c2f33;
  --discord-btn-bg: #23272a;
  --font-family: 'Inter', system-ui, sans-serif;
  --sidebar-width: 240px;
}

/* Base */
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-color);
  font-family: var(--font-family);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/* Layout container */
.container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar (inchangé visuellement mais modernisé) */
nav.sidebar {
  width: var(--sidebar-width);
  background: var(--red);
  color: var(--white);
  padding: 28px 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
nav.sidebar ul { list-style: none; padding: 0; margin: 0; display:flex; flex-direction:column; gap:12px;}
nav.sidebar li a {
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  transition: all .18s ease;
}
nav.sidebar li a:hover { transform: translateX(6px); background: var(--white); color: var(--red); box-shadow: 0 8px 20px rgba(0,0,0,0.12); }
nav.sidebar li a i { min-width: 22px; text-align:center; }

/* Main area */
main.wrap {
  flex-grow: 1;
  padding: 0;
  background: transparent;
  color: var(--text-color);
}

/* HEADER (sticky, full width of main, user avatar left inside it) */
.store-header {
  background: linear-gradient(90deg, rgba(255,140,66,0.12), rgba(255,59,48,0.08));
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 28px;
  position: sticky;
  top: 0;
  z-index: 80;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

/* header parts */
.header-left { width: 240px; display:flex; align-items:center; }
.header-center { flex: 1; text-align: center; }
.header-right { width: 80px; display:flex; justify-content:flex-end; align-items:center; }

.store-header h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 1px;
  color: #f12d2d;
}
.store-header .accent { background: var(--accent); -webkit-background-clip:text; -webkit-text-fill-color:transparent; }

/* User banner (avatar + name) in the left side */
.user-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  padding: 6px 8px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.04);
}
.user-banner img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.06);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}
.user-meta { display:flex; flex-direction:column; line-height:1; }
.user-name { font-weight:700; color:#ff6f3c; font-size:14px; }
.user-role { font-size:12px; color: rgb(231 24 12 / 78%); }

/* Small icon button */
.icon-btn { background:none; border:none; cursor:pointer; font-size:16px; padding:8px; border-radius:8px; }

/* Discord widget en bulle + container déroulant */
#discord-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: #5865F2;
  box-shadow: 0 10px 30px rgba(88,101,242,0.6);
  z-index: 9999;
  overflow: visible;
  transition: width 0.4s ease, height 0.4s ease, border-radius 0.4s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Quand le widget est ouvert */
#discord-widget.open {
  width: 350px;
  height: 500px;
  border-radius: 12px;
  background-color: var(--discord-bg);
  flex-direction: column;
  padding: 12px 12px 0 12px;
  cursor: default;
}

/* Le bouton icône discord */
#discord-widget button#toggle-btn {
  all: unset;
  color: white;
  font-size: 28px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  cursor: pointer;
  user-select: none;
}

/* Masquer le texte du bouton */
#discord-widget button#toggle-btn span {
  display: none;
}

/* iframe caché quand minimisé */
#discord-widget iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 12px;
  display: none;
  flex-grow: 1;
  margin-top: 12px;
}

/* iframe visible quand ouvert */
#discord-widget.open iframe {
  display: block;
}

/* Ajouter un bouton "fermer" en haut à droite */
#discord-widget.open button#close-btn {
  all: unset;
  color: #ccc;
  font-size: 28px;
  cursor: pointer;
  position: absolute;
  top: 8px;
  right: 12px;
  user-select: none;
  transition: color 0.3s;
  z-index: 10000;
}

#discord-widget.open button#close-btn:hover {
  color: #ff3b30;
}

/* Grid produits — nouveau style futuriste */
.grid {
  padding: 28px;
  max-width: calc(100% - var(--sidebar-width));
  margin-left: var(--sidebar-width); /* s'assurer que le contenu ne dépasse pas la sidebar */
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

/* Card améliorée */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(250,250,250,0.98));
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(16,24,40,0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
  border: 1px solid rgba(16,24,40,0.04);
  cursor: pointer;
}
body.dark-theme .card {
  background: linear-gradient(180deg, rgba(20,20,20,0.75), rgba(10,10,10,0.75));
  border: 1px solid rgba(255,255,255,0.03);
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
}
.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 18px 40px rgba(16,24,40,0.12);
}

/* Media / image */
.card-media {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.04));
}
.card-media img {
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
  transition: transform .5s ease;
}
.card:hover .card-media img { transform: scale(1.06); }

/* Overlay actions on image */
.card-overlay {
  position: absolute;
  inset: 0;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  padding: 12px;
  pointer-events: none;
}
.badge {
  pointer-events: auto;
  align-self: flex-start;
  background: linear-gradient(90deg, rgba(255,140,66,0.95), rgba(255,59,48,0.95));
  color: white;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: 0 8px 20px rgba(255,110,55,0.14);
  transform: translateY(4px); /* ajuste selon besoin */
}

.actions {
  pointer-events: auto;
  display:flex;
  gap:8px;
  align-items:center;
  justify-content:flex-end;
}
.btn {
  border: none;
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;

  transform: translateY(4px); /* ajuste la valeur */
}


.btn-ghost {
  background: rgba(255,255,255,0.12);
  color: #f52929;
  backdrop-filter: blur(2px);
}
.btn-primary {
  background: linear-gradient(90deg,var(--orange),var(--red));
  color: #fff;
  box-shadow: 0 8px 20px rgba(255,110,55,0.18);
}

/* Body of card */
.card-body {
  padding: 16px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.card-title {
  margin:0;
  font-size:16px;
  color: #ff4040;
  font-weight:800;
}
.desc {
  margin:0;
  font-size:13px;
  color: #444;
  max-height: 68px;
  overflow: hidden;
  transition: max-height .25s ease;
}
.desc.expanded { max-height: 1000px; }

/* Footer area of card */
.card-footer {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-top:auto;
}
.price { font-weight:900; color: var(--price-color); font-size:16px; }
.meta-right { color: #888; font-size:12px; }

/* No preview */
.no-preview { display:flex; align-items:center; justify-content:center; height:100%; color:#bbb; font-size:14px; }

/* Modal styles (modern) */
#product-modal { position: fixed; inset:0; display:flex; align-items:center; justify-content:center; z-index:12000; pointer-events:none; opacity:0; transition:opacity .24s ease; }
#product-modal.modal-visible { pointer-events:auto; opacity:1; }
#product-modal .modal-overlay { position:absolute; inset:0; background:rgba(2,6,23,0.6); }
#product-modal .modal-content {
  position:relative;
  background: linear-gradient(180deg,#fff,#fff);
  width: min(900px, 92vw);
  max-height: 86vh;
  border-radius: 12px;
  overflow:auto;
  padding:22px;
  z-index:12001;
  box-shadow: 0 18px 50px rgba(2,6,23,0.45);
}
body.dark-theme #product-modal .modal-content {
  background: linear-gradient(180deg,#0b0b0b,#0f0f0f);
}
#modal-close { position:absolute; right:16px; top:12px; font-size:26px; border:none; background:none; cursor:pointer; }
.modal-image img { max-width:100%; max-height:360px; object-fit:contain; display:block; margin:0 auto 10px; }
.modal-meta { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:6px; }
.modal-description { color:#3b92c7; line-height:1.45; }

/* Footer area */
footer { padding:22px 28px; color:#666; text-align:center; }

/* Buttons used outside card (theme toggle) */
#theme-toggle {
  position: fixed;
  top: 12px;
  right: 12px;
  padding: 8px 12px;
  background: var(--btn-bg);
  color: var(--white);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  z-index: 10000;
  font-weight: bold;
}

/* Responsive */
@media (max-width: 1100px){
  .grid { margin-left: 0; max-width:100%; padding:16px; grid-template-columns: repeat(auto-fill,minmax(260px,1fr)); }
  .header-left { display:none; } /* cacher l'avatar sur petits écrans */
  .store-header { padding:12px; }
}

/* Dark theme overrides (corrections) */
body.dark-theme {
  --bg: #121212; /* fond très foncé */
  --text-color: #ffffff; /* texte gris clair */
  --shadow: 0 6px 20px rgba(255, 255, 255, 0.15);
  --header-bg: linear-gradient(90deg, #ff3b30, #ff8c42); /* peut rester rouge/orange */
  --btn-bg: linear-gradient(90deg, #ff3b30, #ff8c42);
  --price-color: #ff6b5c; /* rouge clair */
  --price-icon-color: #ff9e65; /* orange clair */
  --discord-bg: #2c2f33;
  --discord-btn-bg: #23272a;
}


/* small helpers */
.hidden { display:none !important; }

#theme-toggle {
  background: none;
  border: none;
  outline: none;
  box-shadow: none;
  cursor: pointer;
  font-size: 24px; /* ou la taille que tu veux */
  line-height: 1;
  padding: 6px 10px;
  color: inherit; /* pour prendre la couleur du texte */
  user-select: none;
  -webkit-tap-highlight-color: transparent; /* en mobile, pas d'effet */
}

#theme-toggle:focus {
  outline: none;
  box-shadow: none;
}
