/* ================================================================
   AdForest — Modern Hero Widget  |  assets/css/hero.css
   Design World-Class 2025 — Conçu pour dominer le marché Afrique
   ================================================================ */

/* ─── Reset scoped ──────────────────────────────────────────── */
.adfh-hero *, .adfh-cats * { box-sizing: border-box; }
.adfh-hero a, .adfh-cats a { text-decoration: none; }

/* ─── Variables globales ──────────────────────────────────────
   Surchargeables via :root ou depuis le rendu PHP inline        */
:root {
  --adfh-ease: cubic-bezier(.4, 0, .2, 1);
  --adfh-ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --adfh-radius-xl: 24px;
  --adfh-radius-lg: 18px;
  --adfh-radius-md: 12px;
  --adfh-radius-sm: 8px;
  --adfh-shadow-glow: 0 0 60px rgba(var(--brand-rgb, 245,158,11), .20);
  --adfh-font: 'Poppins', system-ui, -apple-system, sans-serif;
}

/* ================================================================
   HERO — Section principale
   ================================================================ */
.adfh-hero {
  position: relative;
  overflow: hidden;
  padding: 0 0 0;
  font-family: var(--adfh-font);
}

/* Grille lumineuse en fond */
.adfh-hero__grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* Orbes / halos lumineux */
.adfh-hero__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: adfh-orb-pulse 8s ease-in-out infinite alternate;
}
.adfh-hero__orb--1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(var(--brand-rgb, 245,158,11), .18) 0%, transparent 70%);
  top: -200px; left: -150px;
  animation-delay: 0s;
}
.adfh-hero__orb--2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(56,189,248,.12) 0%, transparent 70%);
  bottom: 0; right: -100px;
  animation-delay: -3s;
}
.adfh-hero__orb--3 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(167,139,250,.10) 0%, transparent 70%);
  top: 30%; left: 50%; transform: translateX(-50%);
  animation-delay: -5s;
}
@keyframes adfh-orb-pulse {
  from { opacity: .7; transform: scale(1); }
  to   { opacity: 1;  transform: scale(1.12); }
}
.adfh-hero__orb--3 {
  animation-name: adfh-orb-pulse-3;
}
@keyframes adfh-orb-pulse-3 {
  from { opacity: .6; transform: translateX(-50%) scale(1); }
  to   { opacity: 1;  transform: translateX(-50%) scale(1.15); }
}

/* Wrapper interne */
.adfh-hero__inner {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 100px 32px 60px;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 56px;
  align-items: center;
}

/* ─── Bloc texte ──────────────────────────────────────────── */
.adfh-hero__text {
  color: #fff;
}

/* Badge */
.adfh-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.10);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 999px;
  padding: 7px 18px 7px 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .03em;
  color: rgba(255,255,255,.95);
  margin-bottom: 24px;
  animation: adfh-fade-in .6s var(--adfh-ease) both;
}
.adfh-badge__dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--brand, #f59e0b);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb,245,158,11),.30);
  animation: adfh-dot-pulse 2s ease-in-out infinite;
}
@keyframes adfh-dot-pulse {
  0%,100% { box-shadow: 0 0 0 3px rgba(var(--brand-rgb,245,158,11),.30); }
  50%      { box-shadow: 0 0 0 6px rgba(var(--brand-rgb,245,158,11),.10); }
}

/* Titre */
.adfh-hero__headline {
  font-size: clamp(32px, 4.5vw, 58px);
  font-weight: 800;
  line-height: 1.12;
  color: #fff;
  margin: 0 0 20px;
  letter-spacing: -.03em;
  animation: adfh-slide-up .7s var(--adfh-ease) .1s both;
}
.adfh-hero__headline span {
  display: block;
}
.adfh-hero__accent {
  display: block;
  font-style: normal;
  background: linear-gradient(135deg, var(--brand, #f59e0b) 0%, #fcd34d 60%, #fb923c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-fill-color: transparent;
  filter: drop-shadow(0 0 20px rgba(var(--brand-rgb,245,158,11),.35));
}

/* Sous-titre */
.adfh-hero__subtitle {
  font-size: 16px;
  line-height: 1.65;
  color: rgba(255,255,255,.70);
  max-width: 440px;
  margin: 0 0 32px;
  animation: adfh-slide-up .7s var(--adfh-ease) .2s both;
}

/* Statistiques rapides */
.adfh-hero__stats {
  display: flex;
  gap: 32px;
  animation: adfh-slide-up .7s var(--adfh-ease) .3s both;
}
.adfh-hero__stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.adfh-hero__stat strong {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.02em;
  line-height: 1;
}
.adfh-hero__stat span {
  font-size: 12px;
  color: rgba(255,255,255,.50);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ─── Barre de recherche ──────────────────────────────────── */
.adfh-hero__search-wrap {
  position: relative;
  z-index: 3;
  animation: adfh-slide-up .8s var(--adfh-ease) .15s both;
}

/* Carte glassmorphism */
.adfh-search {
  display: flex;
  align-items: stretch;
  background: rgba(255,255,255,.97);
  border-radius: var(--adfh-radius-xl);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.15),
    0 8px 32px rgba(0,0,0,.18),
    0 2px 8px rgba(0,0,0,.10),
    var(--adfh-shadow-glow);
  overflow: hidden;
  min-height: 74px;
}

/* Champ de saisie */
.adfh-search__field {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 14px 20px;
  position: relative;
  transition: background .2s var(--adfh-ease);
}
.adfh-search__field:focus-within {
  background: rgba(var(--brand-rgb, 245,158,11), .04);
}

/* Étiquette interne */
.adfh-search__label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 4px;
  cursor: default;
}
.adfh-search__label svg {
  width: 13px; height: 13px;
  color: var(--brand, #f59e0b);
  flex-shrink: 0;
}

/* Input / Select */
.adfh-search__input,
.adfh-search__select {
  background: transparent;
  border: 0;
  outline: 0;
  font-family: var(--adfh-font);
  font-size: 15px;
  font-weight: 500;
  color: #0f172a;
  width: 100%;
  padding: 0;
  line-height: 1.4;
  cursor: text;
  -webkit-appearance: none;
  appearance: none;
}
.adfh-search__select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M5 8l5 5 5-5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
  background-size: 16px;
  padding-right: 20px;
}
.adfh-search__input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

/* Séparateur vertical */
.adfh-search__sep {
  width: 1px;
  background: linear-gradient(180deg, transparent, #e2e8f0 30%, #e2e8f0 70%, transparent);
  flex-shrink: 0;
  align-self: center;
  height: 44px;
}

/* Bouton CTA */
.adfh-search__btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--brand, #f59e0b);
  color: var(--brand-text, #fff);
  border: 0;
  margin: 8px;
  border-radius: calc(var(--adfh-radius-xl) - 8px);
  padding: 0 28px;
  font-family: var(--adfh-font);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: -.01em;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.25),
    0 4px 12px rgba(var(--brand-rgb,245,158,11),.40),
    0 1px 3px rgba(var(--brand-rgb,245,158,11),.30);
  transition:
    background .25s var(--adfh-ease),
    transform .2s var(--adfh-ease-spring),
    box-shadow .25s var(--adfh-ease);
}
.adfh-search__btn:hover {
  background: var(--brand-hov, #d97706);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.28),
    0 8px 20px rgba(var(--brand-rgb,245,158,11),.45),
    0 2px 6px rgba(var(--brand-rgb,245,158,11),.35);
}
.adfh-search__btn:active {
  transform: translateY(0);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.15),
    0 2px 6px rgba(var(--brand-rgb,245,158,11),.30);
}
.adfh-search__btn-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
}

/* Suggestions rapides */
.adfh-search__quick {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  padding: 0 4px;
}
.adfh-search__quick-label {
  font-size: 12px;
  color: rgba(255,255,255,.55);
  font-weight: 500;
}
.adfh-search__quick-tag {
  display: inline-flex;
  align-items: center;
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,.80);
  transition: background .2s var(--adfh-ease), color .2s var(--adfh-ease), border-color .2s var(--adfh-ease);
}
.adfh-search__quick-tag:hover {
  background: rgba(255,255,255,.22);
  color: #fff;
  border-color: rgba(255,255,255,.30);
}

/* ─── Tuiles Pays ─────────────────────────────────────────── */
.adfh-hero__countries {
  position: relative;
  z-index: 2;
  background: rgba(0,0,0,.20);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 28px 0;
}
.adfh-hero__countries-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}
.adfh-hero__countries-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
  margin: 0 0 16px;
}
.adfh-hero__countries-track {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Tuile pays */
.adfh-country-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  cursor: pointer;
  transition: transform .2s var(--adfh-ease-spring), opacity .2s var(--adfh-ease);
}
.adfh-country-chip:hover {
  transform: translateY(-3px);
  opacity: 1 !important;
}
.adfh-hero__countries-track:hover .adfh-country-chip {
  opacity: .6;
}
.adfh-hero__countries-track:hover .adfh-country-chip:hover {
  opacity: 1;
}

.adfh-country-chip__flag {
  width: 56px; height: 56px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255,255,255,.12);
  border: 2px solid rgba(255,255,255,.20);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.20);
  transition: border-color .2s var(--adfh-ease), box-shadow .2s var(--adfh-ease);
}
.adfh-country-chip:hover .adfh-country-chip__flag {
  border-color: var(--brand, #f59e0b);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb,245,158,11),.30), 0 4px 12px rgba(0,0,0,.20);
}
.adfh-country-chip__flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.adfh-country-chip__flag-fallback {
  font-size: 16px;
  font-weight: 700;
  color: rgba(255,255,255,.80);
  text-transform: uppercase;
}
.adfh-country-chip__name {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,.70);
  max-width: 60px;
  line-height: 1.2;
  transition: color .2s var(--adfh-ease);
}
.adfh-country-chip:hover .adfh-country-chip__name {
  color: rgba(255,255,255,.95);
}

/* ================================================================
   CATÉGORIES — Section séparée (fond blanc)
   ================================================================ */
.adfh-cats {
  background: #fff;
  padding: 60px 0 72px;
  font-family: var(--adfh-font);
}
.adfh-cats__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

/* En-tête section */
.adfh-cats__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
  gap: 16px;
}
.adfh-cats__title {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -.03em;
  margin: 0;
  position: relative;
}
.adfh-cats__title::after {
  content: '';
  display: block;
  width: 40px;
  height: 4px;
  background: var(--brand, #f59e0b);
  border-radius: 2px;
  margin-top: 8px;
}
.adfh-cats__see-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand, #f59e0b);
  border: 1.5px solid rgba(var(--brand-rgb,245,158,11),.30);
  border-radius: 999px;
  padding: 8px 18px;
  transition: background .2s var(--adfh-ease), color .2s var(--adfh-ease), border-color .2s var(--adfh-ease);
  white-space: nowrap;
}
.adfh-cats__see-all svg { width: 14px; height: 14px; }
.adfh-cats__see-all:hover {
  background: var(--brand, #f59e0b);
  color: #fff;
  border-color: var(--brand, #f59e0b);
}

/* Grille catégories */
.adfh-cats__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

/* Carte catégorie */
.adfh-cat-card {
  background: var(--card-bg, #fff7e6);
  border-radius: var(--adfh-radius-lg);
  padding: 24px 18px 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  position: relative;
  overflow: hidden;
  transition:
    transform .22s var(--adfh-ease-spring),
    box-shadow .22s var(--adfh-ease);
  cursor: pointer;
  border: 1.5px solid transparent;
}
.adfh-cat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--card-glow, rgba(245,158,11,.10));
  opacity: 0;
  transition: opacity .22s var(--adfh-ease);
  pointer-events: none;
  border-radius: inherit;
}
.adfh-cat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.04);
  border-color: rgba(var(--brand-rgb,245,158,11),.18);
}
.adfh-cat-card:hover::before { opacity: 1; }

/* Icône */
.adfh-cat-card__icon-wrap {
  width: 52px; height: 52px;
  border-radius: var(--adfh-radius-md);
  background: rgba(255,255,255,.85);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  color: var(--card-fg, #b45309);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  flex-shrink: 0;
  transition: transform .22s var(--adfh-ease-spring);
}
.adfh-cat-card:hover .adfh-cat-card__icon-wrap {
  transform: scale(1.06);
}
.adfh-cat-card__icon-wrap img {
  width: 32px; height: 32px;
  object-fit: contain;
}
.adfh-cat-card__icon-wrap svg {
  width: 28px; height: 28px;
  color: var(--card-fg, #b45309);
}

/* Nom */
.adfh-cat-card__name {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
  letter-spacing: -.01em;
}

/* Compteur */
.adfh-cat-card__count {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

/* Flèche */
.adfh-cat-card__arrow {
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,.70);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--card-fg, #b45309);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .2s var(--adfh-ease), transform .2s var(--adfh-ease);
}
.adfh-cat-card__arrow svg { width: 14px; height: 14px; }
.adfh-cat-card:hover .adfh-cat-card__arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ─── Animations d'entrée ─────────────────────────────────── */
@keyframes adfh-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes adfh-slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

/* Tablette large */
@media (max-width: 1100px) {
  .adfh-cats__grid { grid-template-columns: repeat(4, 1fr); }
}

/* Tablette */
@media (max-width: 900px) {
  .adfh-hero__inner {
    grid-template-columns: 1fr;
    gap: 36px;
    padding: 80px 24px 48px;
  }
  .adfh-hero__text { text-align: center; }
  .adfh-hero__subtitle { margin-left: auto; margin-right: auto; }
  .adfh-hero__stats { justify-content: center; }
  .adfh-cats__grid { grid-template-columns: repeat(3, 1fr); }
}

/* Mobile */
@media (max-width: 680px) {
  .adfh-hero__inner { padding: 70px 20px 40px; }

  /* Barre de recherche verticale */
  .adfh-search {
    flex-direction: column;
    border-radius: var(--adfh-radius-lg);
    min-height: auto;
  }
  .adfh-search__sep {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0 30%, #e2e8f0 70%, transparent);
    align-self: auto;
  }
  .adfh-search__btn {
    margin: 8px;
    padding: 16px 24px;
    border-radius: calc(var(--adfh-radius-lg) - 8px);
    width: calc(100% - 16px);
  }
  .adfh-search__btn-text { font-size: 15px; }

  .adfh-hero__stats { gap: 20px; }
  .adfh-hero__stat strong { font-size: 22px; }

  /* Pays */
  .adfh-hero__countries-track { gap: 10px; }
  .adfh-country-chip__flag { width: 46px; height: 46px; }

  /* Catégories */
  .adfh-cats__grid { grid-template-columns: repeat(2, 1fr); }
  .adfh-cats { padding: 40px 0 52px; }
  .adfh-cats__inner { padding: 0 16px; }
}

/* Petit mobile */
@media (max-width: 400px) {
  .adfh-cats__grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .adfh-cat-card { padding: 18px 14px 16px; }
  .adfh-hero__countries-track { gap: 8px; }
  .adfh-country-chip__flag { width: 40px; height: 40px; }
  .adfh-country-chip__name { font-size: 10px; max-width: 48px; }
}

/* Espace pour header fixed AdForest Modern */
body.adf-hm-transparent-header .adfh-hero {
  padding-top: 0 !important;
}
body.adf-hm-transparent-header .adfh-hero__inner {
  padding-top: 130px;
}
@media (max-width: 991px) {
  body.adf-hm-transparent-header .adfh-hero__inner { padding-top: 110px; }
}
@media (max-width: 600px) {
  body.adf-hm-transparent-header .adfh-hero__inner { padding-top: 90px; }
}

/* Support Select2 si chargé par AdForest */
.adfh-search .select2-container {
  min-width: 0;
  width: 100% !important;
}
.adfh-search .select2-container--default .select2-selection--single {
  background: transparent;
  border: 0;
  height: auto;
  padding: 0;
}
.adfh-search .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #0f172a;
  font-size: 15px;
  font-weight: 500;
  padding: 0;
  line-height: 1.4;
}
.adfh-search .select2-container--default .select2-selection--single .select2-selection__arrow {
  display: none;
}
