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

:root {
  --bg: #0f0f0f;
  --card-bg: #1a1a1a;
  --card-border: #2a2a2a;
  --text: #eeeeee;
  --text-muted: #888888;
  --accent: #6c5ce7;
  --accent-hover: #7f70f0;
  --green: #00b894;
  --red: #e74c3c;
  --radius: 12px;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
header {
  text-align: center;
  padding: 3rem 1rem 2rem;
}

header h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent), #a29bfe);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

header p {
  color: var(--text-muted);
  margin-top: 0.4rem;
  font-size: 1.05rem;
}

/* ── Featured Brands ── */
.featured-brands {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.brand-card {
  position: relative;
  display: block;
  width: 300px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--card-border);
  text-decoration: none;
  transition: transform 0.2s, border-color 0.2s;
}

.brand-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.brand-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.brand-card-overlay {
  background: var(--card-bg);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.brand-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.brand-card-count {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
}

.brand-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
}

/* ── Filters ── */
.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 1rem 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.filter-btn {
  background: var(--card-bg);
  color: var(--text-muted);
  border: 1px solid var(--card-border);
  padding: 0.45rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.filter-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── Grid ── */
.promo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
  padding: 0 1.5rem 3rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* ── Card ── */
.promo-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 0.2s, border-color 0.2s;
  position: relative;
}

.promo-card:hover {
  transform: translateY(-3px);
  border-color: #3a3a3a;
}

.promo-card.featured {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(108, 92, 231, 0.15);
}

.promo-card.expired {
  opacity: 0.45;
  pointer-events: none;
}

.promo-card.expired::after {
  content: "Expiré";
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--red);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  text-transform: uppercase;
}

.featured-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  text-transform: uppercase;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-header img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  padding: 4px;
}

.card-header .brand-info h3 {
  font-size: 1rem;
  font-weight: 700;
}

.card-header .brand-info .category-tag {
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-description {
  font-size: 0.92rem;
  color: var(--text-muted);
  flex: 1;
}

.card-expiry {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Code reveal zone ── */
.code-zone {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.code-hidden {
  flex: 1;
  background: #111;
  border: 1px dashed var(--card-border);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  text-align: center;
  font-family: monospace;
  font-size: 0.95rem;
  letter-spacing: 3px;
  color: var(--text-muted);
  user-select: none;
}

.code-revealed {
  flex: 1;
  background: #111;
  border: 1px solid var(--green);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  text-align: center;
  font-family: monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 1px;
  animation: revealPop 0.3s ease;
}

@keyframes revealPop {
  0% {
    transform: scale(0.9);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.btn-reveal {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s;
}

.btn-reveal:hover {
  background: var(--accent-hover);
}

.btn-copy {
  background: var(--green);
  color: #fff;
  border: none;
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s;
}

.btn-copy:hover {
  background: #00d6a4;
}

/* ── Footer ── */
footer {
  text-align: center;
  padding: 2rem 1rem;
  margin-top: auto;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--card-border);
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
  grid-column: 1 / -1;
}

/* ── Brand Header (page dédiée) ── */
.brand-header {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 2rem;
  text-align: center;
}

.brand-header .brand-identity {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.brand-header .brand-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  padding: 6px;
}

.brand-header h1 {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #a29bfe);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-header .brand-baseline {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.brand-header .brand-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.brand-header .brand-stats .stat {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 600;
}

.brand-header .brand-stats .stat strong {
  color: var(--accent);
}

.brand-header .visit-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.brand-header .visit-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* ── Offer List (vertical) ── */
.offer-list {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.offer-row {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  display: flex;
  align-items: stretch;
  transition: border-color 0.2s, transform 0.2s;
}

.offer-row:hover {
  border-color: #3a3a3a;
  transform: translateY(-2px);
}

.offer-badge-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  padding: 1.25rem 0.75rem;
  border-right: 1px solid var(--card-border);
  gap: 0.4rem;
}

.offer-badge {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.offer-badge.code {
  color: var(--accent);
}

.offer-badge.deal {
  color: var(--green);
}

.offer-type {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  text-align: center;
}

.offer-type.code {
  background: rgba(108, 92, 231, 0.15);
  color: var(--accent);
}

.offer-type.deal {
  background: rgba(0, 184, 148, 0.15);
  color: var(--green);
}

.offer-content {
  flex: 1;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.3rem;
}

.offer-content h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.offer-content .offer-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.offer-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  gap: 0.5rem;
  min-width: 150px;
}

.offer-action .btn-offer {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.65rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s;
  text-decoration: none;
  text-align: center;
  width: 100%;
}

.offer-action .btn-offer:hover {
  background: var(--accent-hover);
}

.offer-action .btn-offer.deal {
  background: var(--green);
}

.offer-action .btn-offer.deal:hover {
  background: #00d6a4;
}

.offer-action .offer-expiry {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}

/* Code reveal dans offer-row */
.offer-code-zone {
  display: none;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.offer-code-zone.revealed {
  display: flex;
}

.offer-code-zone .code-revealed {
  flex: 1;
}

/* ── SEO Section ── */
.seo-section {
  max-width: 900px;
  margin: 2rem auto 0;
  padding: 2.5rem 1.5rem 3rem;
  border-top: 1px solid var(--card-border);
}

.seo-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}

.seo-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
  color: var(--text);
}

.seo-section p,
.seo-section li {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.seo-section ol,
.seo-section ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.seo-section ol li,
.seo-section ul li {
  margin-bottom: 0.4rem;
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.faq-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-item summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.2s;
}

.faq-item summary:hover {
  background: rgba(255, 255, 255, 0.03);
}

.faq-item summary::after {
  content: "+";
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item .faq-answer {
  padding: 0 1.25rem 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* Category links / tags */
.category-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.category-links a {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text);
  text-decoration: none;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
}

.category-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 1rem 1.5rem;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--accent);
}

/* ── Responsive ── */
@media (max-width: 640px) {
  header {
    padding: 2rem 1rem 1.5rem;
  }

  header h1 {
    font-size: 1.5rem;
  }

  .featured-brands {
    padding: 0 1rem 1.5rem;
  }

  .brand-card {
    width: 100%;
  }

  .promo-grid {
    grid-template-columns: 1fr;
    padding: 0 1rem 2rem;
  }

  .code-zone {
    flex-direction: column;
  }

  .code-hidden,
  .code-revealed {
    width: 100%;
  }

  .btn-reveal,
  .btn-copy {
    width: 100%;
  }

  /* Brand header mobile */
  .brand-header {
    padding: 1.5rem 1rem 1rem;
  }

  .brand-header .brand-identity {
    gap: 0.75rem;
  }

  .brand-header .brand-logo {
    width: 44px;
    height: 44px;
  }

  .brand-header h1 {
    font-size: 1.5rem;
  }

  /* Offer list mobile */
  .offer-list {
    padding: 0 1rem 2rem;
  }

  .offer-row {
    flex-direction: column;
  }

  .offer-badge-col {
    flex-direction: row;
    min-width: unset;
    border-right: none;
    border-bottom: 1px solid var(--card-border);
    padding: 0.75rem 1rem;
  }

  .offer-badge {
    font-size: 1.1rem;
  }

  .offer-content {
    padding: 1rem;
  }

  .offer-action {
    padding: 0 1rem 1rem;
    min-width: unset;
  }

  .offer-action .btn-offer {
    width: 100%;
  }

  .offer-code-zone {
    flex-direction: column;
  }

  /* SEO mobile */
  .seo-section {
    padding: 2rem 1rem;
  }

  .seo-section h2 {
    font-size: 1.25rem;
  }
}
