/* ============================================================================
   AfricArt Analytics v2.0 — Stylesheet
   Artscapy-quality design: tabs, charts, stat cards, badges, responsive
   ============================================================================ */

/* ── CSS Variables ─────────────────────────────────────────────────────────── */
.africart-widget {
  --aa-blue       : #1565C0;
  --aa-blue-light : #1976D2;
  --aa-grey       : #78909C;
  --aa-green      : #2E7D32;
  --aa-red        : #C62828;
  --aa-amber      : #FF8F00;
  --aa-text       : #37474F;
  --aa-text-light : #607D8B;
  --aa-border     : #ECEFF1;
  --aa-bg         : #FAFBFC;
  --aa-white      : #FFFFFF;
  --aa-tab-h      : 44px;
  --aa-radius     : 8px;
  --aa-shadow     : 0 2px 8px rgba(0,0,0,.08);

  font-family   : inherit;
  color         : var(--aa-text);
  line-height   : 1.5;
  box-sizing    : border-box;
  background    : var(--aa-white);
  border        : 1px solid var(--aa-border);
  border-radius : var(--aa-radius);
  overflow      : hidden;
}
.africart-widget *, .africart-widget *::before, .africart-widget *::after { box-sizing: inherit; }

/* ── Tab navigation ────────────────────────────────────────────────────────── */
.africart-tabs {
  display         : flex;
  overflow-x      : auto;
  background      : var(--aa-bg);
  border-bottom   : 2px solid var(--aa-border);
  scrollbar-width : none;
  -ms-overflow-style: none;
  padding         : 0 12px;
  gap             : 2px;
}
.africart-tabs::-webkit-scrollbar { display: none; }

.africart-tab {
  flex            : 0 0 auto;
  height          : var(--aa-tab-h);
  padding         : 0 18px;
  border          : none;
  border-bottom   : 3px solid transparent;
  margin-bottom   : -2px;
  background      : transparent;
  color           : var(--aa-text-light);
  font-size       : 13px;
  font-weight     : 500;
  cursor          : pointer;
  white-space     : nowrap;
  transition      : color .2s, border-color .2s;
}
.africart-tab:hover { color: var(--aa-blue); }
.africart-tab--active {
  color        : var(--aa-blue);
  border-color : var(--aa-blue);
  font-weight  : 600;
}

/* ── Loading spinner ───────────────────────────────────────────────────────── */
.africart-loading {
  display         : flex;
  align-items     : center;
  justify-content : center;
  gap             : 12px;
  padding         : 60px 20px;
  color           : var(--aa-text-light);
  font-size       : 14px;
}
.africart-spinner {
  width           : 24px;
  height          : 24px;
  border          : 3px solid var(--aa-border);
  border-top-color: var(--aa-blue);
  border-radius   : 50%;
  animation       : aa-spin .7s linear infinite;
  flex-shrink     : 0;
}
@keyframes aa-spin { to { transform: rotate(360deg); } }

/* ── Error state ───────────────────────────────────────────────────────────── */
.africart-error-msg {
  padding    : 40px 20px;
  text-align : center;
  color      : var(--aa-text-light);
  font-size  : 14px;
}

/* ── Panels ────────────────────────────────────────────────────────────────── */
.africart-panel { display: none; padding: 20px; }
.africart-panel--active { display: block; }

/* ── Meta row (badges + pills) ─────────────────────────────────────────────── */
.africart-meta {
  display     : flex;
  flex-wrap   : wrap;
  align-items : center;
  gap         : 8px;
  margin-bottom: 16px;
}

/* Liquidity badge */
.africart-badge {
  display       : inline-flex;
  align-items   : center;
  padding       : 4px 12px;
  border-radius : 20px;
  font-size     : 12px;
  font-weight   : 600;
  letter-spacing: .3px;
}
.africart-badge--liq[data-liq="very_high"],
.africart-badge--liq[data-liq="high"]      { background: #E8F5E9; color: var(--aa-green); }
.africart-badge--liq[data-liq="medium"]    { background: #FFF8E1; color: var(--aa-amber); }
.africart-badge--liq[data-liq="low"],
.africart-badge--liq[data-liq="very_low"]  { background: #FFEBEE; color: var(--aa-red); }
.africart-badge--markets {
  background : #E3F2FD;
  color      : var(--aa-blue);
  font-weight: 500;
}

/* Quick stat pills */
.africart-pill {
  display     : inline-flex;
  align-items : center;
  gap         : 5px;
  padding     : 4px 12px;
  background  : var(--aa-bg);
  border      : 1px solid var(--aa-border);
  border-radius: 20px;
  font-size   : 12px;
}
.africart-pill__label { color: var(--aa-text-light); }
.africart-pill__val   { font-weight: 700; color: var(--aa-text); }

/* ── AI summary block ──────────────────────────────────────────────────────── */
.africart-ai {
  background    : linear-gradient(135deg, #F3F8FF 0%, #EFF6FF 100%);
  border-left   : 4px solid var(--aa-blue);
  border-radius : 0 var(--aa-radius) var(--aa-radius) 0;
  padding       : 14px 18px;
  margin-bottom : 24px;
}
.africart-ai__label {
  display       : block;
  font-size     : 10px;
  font-weight   : 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color         : var(--aa-blue);
  margin-bottom : 8px;
}
.africart-ai__text {
  margin     : 0;
  font-size  : 14px;
  line-height: 1.7;
  color      : var(--aa-text);
}

/* ── Chart wraps ───────────────────────────────────────────────────────────── */
.africart-chart-wrap { margin-bottom: 32px; }
.africart-chart-title {
  font-size     : 14px;
  font-weight   : 600;
  color         : var(--aa-text);
  margin        : 0 0 12px 0;
  padding-bottom: 8px;
  border-bottom : 1px solid var(--aa-border);
}

/* Side-by-side layout for Channels */
.africart-charts-row {
  display : flex;
  gap     : 20px;
  flex-wrap: wrap;
}
.africart-chart-wrap--half { flex: 1 1 300px; min-width: 0; }

/* ── Valuation stat grid ───────────────────────────────────────────────────── */
.africart-stat-grid {
  display               : grid;
  grid-template-columns : repeat(auto-fill, minmax(200px, 1fr));
  gap                   : 16px;
  padding               : 4px 0 20px;
}
.africart-stat-card {
  background    : var(--aa-bg);
  border        : 1px solid var(--aa-border);
  border-radius : var(--aa-radius);
  padding       : 18px 16px;
  transition    : box-shadow .2s;
}
.africart-stat-card:hover { box-shadow: var(--aa-shadow); }
.africart-stat-card__label {
  font-size     : 11px;
  font-weight   : 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color         : var(--aa-text-light);
  margin-bottom : 8px;
}
.africart-stat-card__value {
  font-size  : 26px;
  font-weight: 700;
  color      : var(--aa-text);
  line-height: 1;
  margin-bottom: 8px;
}
.africart-stat-card__desc {
  font-size  : 11px;
  color      : var(--aa-text-light);
  line-height: 1.4;
}

/* ── Auction database ──────────────────────────────────────────────────────── */
.africart-db-toolbar {
  display        : flex;
  justify-content: flex-end;
  margin-bottom  : 12px;
}
.africart-search {
  padding     : 8px 14px;
  border      : 1px solid var(--aa-border);
  border-radius: var(--aa-radius);
  font-size   : 13px;
  width       : 260px;
  outline     : none;
  transition  : border-color .2s;
}
.africart-search:focus { border-color: var(--aa-blue); }

.africart-table-scroll { overflow-x: auto; }

.africart-table {
  width          : 100%;
  border-collapse: collapse;
  font-size      : 13px;
}
.africart-table thead th {
  background   : var(--aa-bg);
  border-bottom: 2px solid var(--aa-border);
  padding      : 10px 12px;
  text-align   : left;
  font-weight  : 600;
  color        : var(--aa-text);
  white-space  : nowrap;
}
.africart-table tbody tr {
  border-bottom: 1px solid var(--aa-border);
  transition   : background .15s;
}
.africart-table tbody tr:hover { background: #F8FBFF; }
.africart-table tbody td {
  padding: 9px 12px;
  color  : var(--aa-text);
}
.africart-table .africart-table__title { max-width: 220px; }
.africart-table .africart-table__price {
  font-weight: 600;
  color      : var(--aa-blue);
  white-space: nowrap;
}

/* ── Table image thumbnail ─────────────────────────────────────────────────── */
.africart-table__img-col { width: 52px; }
.africart-table__thumb {
  width        : 44px;
  height       : 44px;
  object-fit   : cover;
  border-radius: 4px;
  border       : 1px solid var(--aa-border);
  display      : block;
  background   : var(--aa-bg);
  transition   : transform .2s, box-shadow .2s;
}
.africart-table tbody tr:hover .africart-table__thumb {
  transform  : scale(1.05);
  box-shadow : 0 4px 12px rgba(0,0,0,.15);
}
.africart-table__thumb-empty {
  color    : var(--aa-text-light);
  font-size: 18px;
  text-align: center;
}

/* ── Pagination ────────────────────────────────────────────────────────────── */
.africart-pagination {
  display         : flex;
  align-items     : center;
  justify-content : space-between;
  padding         : 14px 0 4px;
  gap             : 12px;
}
.africart-pagination__info { font-size: 13px; color: var(--aa-text-light); }

.africart-btn {
  padding      : 8px 18px;
  border       : 1px solid var(--aa-border);
  border-radius: var(--aa-radius);
  background   : var(--aa-white);
  color        : var(--aa-blue);
  font-size    : 13px;
  font-weight  : 500;
  cursor       : pointer;
  transition   : background .2s, color .2s;
}
.africart-btn:hover:not(:disabled) { background: var(--aa-blue); color: var(--aa-white); }
.africart-btn:disabled { opacity: .4; cursor: default; }

/* ── Empty state ───────────────────────────────────────────────────────────── */
.africart-empty {
  text-align : center;
  color      : var(--aa-text-light);
  font-size  : 14px;
  padding    : 32px 20px;
  border     : 1px dashed var(--aa-border);
  border-radius: var(--aa-radius);
}

/* ── Error text ────────────────────────────────────────────────────────────── */
.africart-error { color: var(--aa-red); font-size: 13px; }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .africart-tab          { padding: 0 12px; font-size: 12px; }
  .africart-stat-grid    { grid-template-columns: repeat(2, 1fr); }
  .africart-stat-card__value { font-size: 20px; }
  .africart-meta         { gap: 6px; }
  .africart-charts-row   { flex-direction: column; }
  .africart-chart-wrap--half { flex: 1 1 100%; }
  .africart-search       { width: 100%; }
  .africart-db-toolbar   { justify-content: flex-start; }
  .africart-table thead th,
  .africart-table tbody td { padding: 8px 8px; font-size: 12px; }
  .africart-ai           { padding: 12px 14px; }
  .africart-ai__text     { font-size: 13px; }
}

@media (max-width: 400px) {
  .africart-stat-grid { grid-template-columns: 1fr; }
  .africart-tab { padding: 0 10px; font-size: 11px; }
}

/* ── Libellés d'onglets : version complète (desktop) / version courte (mobile) */
/* La version courte est toujours dans le DOM mais masquée sur desktop            */
.africart-tab__label-m { display: none; }

@media (max-width: 767px) {
  .africart-tab__label   { display: none; }
  .africart-tab__label-m { display: inline; }
}

/* ==========================================================================
   Info Buttons & Popovers  (v2.1.0 — Mission 2 : tooltips JP TOOLTIP+1.pdf)
   ========================================================================== */

/* Wrapper: flex row so the chart title + ⓘ sit on the same line */
.africart-info-wrap {
  display        : flex;
  align-items    : center;
  gap            : 6px;
  position       : relative; /* popover positions against this */
}

/* The ⓘ button itself */
.africart-info-btn {
  display         : inline-flex;
  align-items     : center;
  justify-content : center;
  flex-shrink     : 0;
  width           : 48px;
  height          : 48px;
  min-width       : 48px;
  min-height      : 48px;
  padding         : 0;
  border          : 0;
  border-radius   : 0;
  background      : transparent;
  color           : var(--aa-blue);
  font-size       : 0;
  font-weight     : 700;
  line-height     : 1;
  cursor          : pointer;
  transition      : background 0.15s, color 0.15s;
  /* Prevent the button from being cut off by table overflow */
  overflow        : visible;
}
.africart-info-btn::after {
  content         : 'ⓘ';
  display         : inline-flex;
  align-items     : center;
  justify-content : center;
  width           : 18px;
  height          : 18px;
  border          : 1.5px solid currentColor;
  border-radius   : 50%;
  font-size       : 11px;
  line-height     : 1;
}
.africart-info-btn:hover,
.africart-info-btn:focus-visible {
  color      : var(--aa-blue);
  outline    : none;
}
.africart-info-btn:hover::after,
.africart-info-btn:focus-visible::after {
  background : var(--aa-blue);
  color      : #fff;
}

/* Popover card */
.africart-info-pop {
  position        : absolute;
  top             : calc(100% + 6px);
  left            : 0;
  z-index         : 9999;
  width           : 260px;
  max-width       : calc(100vw - 32px);
  background      : #fff;
  border          : 1px solid var(--aa-border);
  border-radius   : var(--aa-radius);
  box-shadow      : 0 4px 16px rgba(0,0,0,0.12);
  padding         : 12px 14px 10px;
  animation       : aa-pop-in 0.15s ease;
  /* Reset inherited text styles from parent (e.g. uppercase section headers) */
  text-transform  : none;
  letter-spacing  : normal;
  font-weight     : normal;
  color           : inherit;
}
@keyframes aa-pop-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Popover close button (×) */
.africart-info-pop__close {
  position   : absolute;
  top        : 8px;
  right      : 8px;
  width      : 20px;
  height     : 20px;
  padding    : 0;
  border     : none;
  background : transparent;
  color      : var(--aa-text-light);
  font-size  : 16px;
  line-height: 1;
  cursor     : pointer;
  display    : flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition : background 0.12s;
}
.africart-info-pop__close:hover { background: var(--aa-border); }

/* Popover title */
.africart-info-pop__title {
  display     : block;
  font-size   : 13px;
  font-weight : 700;
  color       : var(--aa-text);
  margin-bottom: 5px;
  padding-right: 20px; /* space for × button */
}

/* Popover body text */
.africart-info-pop__body {
  margin     : 0;
  font-size  : 12px;
  line-height: 1.55;
  color      : var(--aa-text-light);
}

/* "En savoir plus" link inside tooltip popover */
.africart-info-pop__more {
  display    : inline-block;
  margin-top : 10px;
  font-size  : 12px;
  font-weight: 600;
  color      : var(--aa-blue);
  text-decoration: none;
}
.africart-info-pop__more:hover { text-decoration: underline; }

.africart-bio-link {
  margin    : 8px 0 0;
  font-size : 12.5px;
}
.africart-bio-link a {
  color                 : #8C6239;
  text-decoration       : underline;
  text-underline-offset : 2px;
}
.africart-bio-link a:hover { color: #6b4a2e; }

/* Responsive: on very narrow screens open popover full-width  */
@media (max-width: 380px) {
  .africart-info-pop {
    width    : calc(100vw - 32px);
    left     : 50%;
    transform: translateX(-50%);
  }
}

/* chart-title inside an info-wrap: remove bottom margin so the wrap handles spacing */
.africart-info-wrap .africart-chart-title {
  margin-bottom : 0;
  border-bottom : none;
  flex          : 1;
}

/* ============================================================================
   5 Environments — v2.2.0
   ============================================================================ */

/* ── Environment colour tokens ─────────────────────────────────────────────── */
.africart-widget {
  --aa-env-ultra        : #E06666;
  --aa-env-contemporain : #2E5A88;
  --aa-env-moderne      : #7B6FA0;
  --aa-env-tribal       : #8C6239;
  --aa-env-antique      : #D4AF37;
  --aa-env-database     : #455A64;
  --aa-success          : #2ECC71;
  --aa-danger           : #E74C3C;
  --aa-bg-light         : #F8F9FA;
}

/* ── Permanent header ─────────────────────────────────────────────────────── */
.africart-header { padding: 20px 20px 0; }

/* ── Scorecard grade tooltip (data-tooltip) ───────────────────────────────── */
.africart-scorecard__grade[data-tooltip] {
  position: relative;
  cursor  : help;
}
.africart-scorecard__grade[data-tooltip]::after {
  content       : attr(data-tooltip);
  display       : none;
  position      : absolute;
  bottom        : calc(100% + 6px);
  left          : 50%;
  transform     : translateX(-50%);
  background    : #2a2a2a;
  color         : #fff;
  font-size     : 11px;
  font-weight   : 400;
  font-style    : normal;
  line-height   : 1.4;
  padding       : 6px 10px;
  border-radius : 5px;
  white-space   : normal;
  width         : 220px;
  text-align    : center;
  z-index       : 100;
  pointer-events: none;
  box-shadow    : 0 2px 8px rgba(0,0,0,.25);
}
.africart-scorecard__grade[data-tooltip]:hover::after,
.africart-scorecard__grade[data-tooltip]:focus::after {
  display: block;
}

/* ── AfricartMarket Index™ watermark (scorecard) ──────────────────────────── */
.africart-index-watermark {
  font-size    : 13px;
  font-weight  : 600;
  font-style   : normal;
  font-family  : Georgia, serif;
  color        : rgba(110,85,55,0.80);
  text-align   : left;
  padding      : 6px 8px 2px;
  line-height  : 1.2;
  grid-column  : 1 / -1;
  margin-top   : 4px;
}

/* ── Brand label + Beta badge ─────────────────────────────────────────────── */
.africart-brand-row {
  display    : flex;
  align-items: center;
  gap        : 7px;
  margin-bottom: 12px;
}
.africart-brand-name {
  font-size  : 13px;
  font-weight: 600;
  color      : var(--aa-text, #2a2a2a);
  letter-spacing: .2px;
}
.africart-beta-badge {
  display      : inline-flex;
  align-items  : center;
  padding      : 2px 7px;
  border-radius: 10px;
  font-size    : 10px;
  font-weight  : 500;
  letter-spacing: .4px;
  text-transform: uppercase;
  background   : rgba(100, 130, 180, 0.12);
  color        : #6482b4;
  border       : 1px solid rgba(100, 130, 180, 0.25);
  line-height  : 1.4;
  vertical-align: middle;
}

/* ── Environment selector ─────────────────────────────────────────────────── */
.africart-env-selector {
  display        : flex;
  flex-wrap      : wrap;
  gap            : 8px;
  padding        : 16px 20px;
  background     : var(--aa-bg-light, #F8F9FA);
  border-top     : 1px solid var(--aa-border);
  border-bottom  : 2px solid var(--aa-border);
}

.africart-env-btn {
  flex           : 1 1 auto;
  padding        : 9px 14px;
  border         : 2px solid transparent;
  border-radius  : var(--aa-radius);
  background     : var(--aa-white);
  font-size      : 12px;
  font-weight    : 600;
  cursor         : pointer;
  transition     : all .2s;
  white-space    : nowrap;
  text-align     : center;
  letter-spacing : .2px;
}
.africart-env-btn:hover { filter: brightness(.92); }

.africart-env-btn[data-env="ultra"]        { border-color: var(--aa-env-ultra);        color: var(--aa-env-ultra); }
.africart-env-btn[data-env="contemporain"] { border-color: var(--aa-env-contemporain); color: var(--aa-env-contemporain); }
.africart-env-btn[data-env="moderne"]      { border-color: var(--aa-env-moderne);       color: var(--aa-env-moderne); }
.africart-env-btn[data-env="tribal"]       { border-color: var(--aa-env-tribal);        color: var(--aa-env-tribal); }
.africart-env-btn[data-env="antique"]      { border-color: var(--aa-env-antique);       color: var(--aa-env-antique); }
.africart-env-btn[data-env="database"]     { border-color: var(--aa-env-database);      color: var(--aa-env-database); }

.africart-env-btn--active[data-env="ultra"]        { background: var(--aa-env-ultra);        color: #fff; border-color: var(--aa-env-ultra); }
.africart-env-btn--active[data-env="contemporain"] { background: var(--aa-env-contemporain); color: #fff; border-color: var(--aa-env-contemporain); }
.africart-env-btn--active[data-env="moderne"]      { background: var(--aa-env-moderne);       color: #fff; border-color: var(--aa-env-moderne); }
.africart-env-btn--active[data-env="tribal"]       { background: var(--aa-env-tribal);        color: #fff; border-color: var(--aa-env-tribal); }
.africart-env-btn--active[data-env="antique"]      { background: var(--aa-env-antique);       color: #fff; border-color: var(--aa-env-antique); }
.africart-env-btn--active[data-env="database"]     { background: var(--aa-env-database);      color: #fff; border-color: var(--aa-env-database); }

/* ── Env panels ─────────────────────────────────────────────────────────────── */
.africart-env-panel          { display: none; }
.africart-env-panel--active  { display: block; }

/* Env-scoped active tab colour overrides */
.africart-env-panel[data-env-panel="ultra"]        .africart-tab--active { color: var(--aa-env-ultra);        border-color: var(--aa-env-ultra); }
.africart-env-panel[data-env-panel="contemporain"] .africart-tab--active { color: var(--aa-env-contemporain); border-color: var(--aa-env-contemporain); }
.africart-env-panel[data-env-panel="moderne"]      .africart-tab--active { color: var(--aa-env-moderne);       border-color: var(--aa-env-moderne); }
.africart-env-panel[data-env-panel="tribal"]       .africart-tab--active { color: var(--aa-env-tribal);        border-color: var(--aa-env-tribal); }
.africart-env-panel[data-env-panel="antique"]      .africart-tab--active { color: var(--aa-env-antique);       border-color: var(--aa-env-antique); }

/* ── Overheating / status alert ─────────────────────────────────────────────── */
.africart-alert {
  display        : flex;
  align-items    : center;
  gap            : 8px;
  padding        : 10px 14px;
  border-radius  : var(--aa-radius);
  font-size      : 13px;
  font-weight    : 600;
  margin-bottom  : 16px;
}
.africart-alert--danger  { background: #FDECEA; color: #C62828; border: 1px solid #FFCDD2; }
.africart-alert--warning { background: #FFF8E1; color: #F57F17; border: 1px solid #FFE082; }
.africart-alert--ok      { background: #E8F5E9; color: #2E7D32; border: 1px solid #C8E6C9; }
.africart-alert--hidden  { display: none; }

/* ── Risk Scorecard (Env 3 — Moderne) ──────────────────────────────────────── */
.africart-scorecard {
  display               : grid;
  grid-template-columns : repeat(auto-fill, minmax(150px, 1fr));
  gap                   : 12px;
  padding               : 4px 0 16px;
}
.africart-scorecard__item {
  background    : var(--aa-bg-light, #F8F9FA);
  border        : 1px solid var(--aa-border);
  border-radius : var(--aa-radius);
  padding       : 14px 12px;
  text-align    : center;
}
.africart-scorecard__label {
  font-size      : 10px;
  font-weight    : 700;
  text-transform : uppercase;
  letter-spacing : .5px;
  color          : var(--aa-text-light);
  margin-bottom  : 8px;
}
.africart-scorecard__grade {
  font-size    : 30px;
  font-weight  : 700;
  line-height  : 1;
  margin-bottom: 4px;
}
.africart-scorecard__grade--A { color: #27AE60; }
.africart-scorecard__grade--B { color: #2ECC71; }
.africart-scorecard__grade--C { color: #F39C12; }
.africart-scorecard__grade--D { color: #E67E22; }
.africart-scorecard__grade--E { color: #E74C3C; }
.africart-scorecard__sublabel {
  font-size : 11px;
  color     : var(--aa-text-light);
}

/* ── Shared Auction Result DB section ─────────────────────────────────────── */
.africart-db-section {
  display : none;
  padding : 0 20px 20px;
}
.africart-db-section--visible {
  display : block;
}

/* ── Upcoming Lot placeholder ──────────────────────────────────────────────── */
.africart-upcoming-placeholder {
  display     : flex;
  align-items : center;
  justify-content : center;
  min-height  : 200px;
  color       : var(--aa-text-light);
  font-size   : 14px;
  font-style  : italic;
}

/* ── Responsive for env selector ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .africart-env-btn  { font-size: 11px; padding: 7px 8px; }
  .africart-header   { padding: 14px 14px 0; }
}

/* ── Sous-sections (Antiquité tardive / Art premier tardif) ─────────────────── */
.africart-subsection {
  margin-top    : 40px;
  padding       : 24px 20px 8px;
  border-top    : 1px solid var(--aa-border, #e2e8f0);
}
.africart-subsection__title {
  display     : flex;
  align-items : center;
  gap         : 10px;
  font-size   : 15px;
  font-weight : 700;
  color       : var(--aa-text, #1a202c);
  margin      : 0 0 20px;
  letter-spacing : 0.02em;
  text-transform : uppercase;
}
.africart-subsection__accent {
  display       : inline-block;
  width         : 4px;
  height        : 20px;
  border-radius : 2px;
  flex-shrink   : 0;
}
/* ══════════════════════════════════════════════════════════════════════════════
   FILTRES AVANCÉS — Panel contextuel
══════════════════════════════════════════════════════════════════════════════ */
.af-filters {
  background    : var(--aa-bg, #fff);
  border        : 1px solid #E0E0E0;
  border-radius : 10px;
  margin        : 0 0 18px 0;
  overflow      : hidden;  /* keep for border-radius clip */
  max-height    : 600px;
  overflow-y    : auto;
  box-shadow    : 0 1px 4px rgba(0,0,0,.06);
}

.af-filters__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  user-select: none;
  background: #F8F9FA;
  border-bottom: 1px solid #E0E0E0;
}
.af-filters__title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  color: #555;
  text-transform: uppercase;
}
.af-filters__toggle {
  background: none;
  border: none;
  font-size: 14px;
  color: #888;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.af-filters--collapsed .af-filters__body { display: none; }

.af-filters__body {
  padding: 14px 16px 12px;
}
.af-filters__row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.af-filters__group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 110px;
  flex: 1 1 110px;
}
.af-filters__group--check {
  justify-content: flex-end;
  min-width: 200px;
  flex: 1.5 1 200px;
}
.af-filters__label {
  font-size: 11px;
  font-weight: 600;
  color: #777;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.af-filters__input,
.af-filters__select {
  height: 34px;
  padding: 0 10px;
  border: 1px solid #CFD8DC;
  border-radius: 6px;
  font-size: 13px;
  color: #333;
  background: #fff;
  outline: none;
  transition: border-color .15s;
  width: 100%;
  box-sizing: border-box;
}
.af-filters__input:focus,
.af-filters__select:focus {
  border-color: #607EBE;
  box-shadow: 0 0 0 2px rgba(96,126,190,.10);
}
.af-filters__check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #555;
  cursor: pointer;
  height: 34px;
}
.af-filters__check-label input[type=checkbox] {
  width: 16px;
  height: 16px;
  accent-color: #607EBE;
  cursor: pointer;
}

.af-filters__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  justify-content: flex-end;
}
.af-filters__btn {
  padding: 7px 20px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background .15s, opacity .15s;
}
.af-filters__btn--apply {
  background: #607EBE;
  color: #fff;
}
.af-filters__btn--apply:hover { opacity: .88; }
.af-filters__btn--reset {
  background: #ECEFF1;
  color: #555;
}
.af-filters__btn--reset:hover { background: #CFD8DC; }


/* ── Accordéon filtres (req. JP — sections fermées par défaut) ──────────────── */
.af-filters__section {
  border-bottom : 1px solid #E0E0E0;
}
.af-filters__section:last-of-type { border-bottom: none; }

.af-filters__section-hdr {
  display         : flex;
  align-items     : center;
  justify-content : space-between;
  padding         : 10px 16px;
  cursor          : pointer;
  user-select     : none;
  background      : transparent;
  border          : none;
  width           : 100%;
  text-align      : left;
}
.af-filters__section-hdr:hover { background: #F5F5F5; }

.af-filters__section-name {
  font-size      : 12px;
  font-weight    : 600;
  color          : #555;
  text-transform : uppercase;
  letter-spacing : .04em;
}
.af-filters__chevron {
  width      : 16px;
  height     : 16px;
  transition : transform .2s ease;
  color      : #888;
  flex-shrink: 0;
}
.af-filters__section--open .af-filters__chevron {
  transform: rotate(180deg);
}
.af-filters__section-body {
  display : none;
  padding : 12px 16px;
  gap     : 10px;
  flex-direction: column;
}
.af-filters__section--open .af-filters__section-body {
  display: flex;
}

/* Dans les sections accordéon, les groupes en row */
.af-filters__section-body .af-filters__group {
  min-width : 0;
  flex      : 1 1 130px;
}
.af-filters__section-body--row {
  flex-direction : row !important;
  flex-wrap      : wrap;
}

/* ── Active filter count badge ──────────────────────────────────────────── */
.af-filters__active-count {
  font-size   : 11px;
  font-weight : 600;
  color       : #607EBE;
  margin-left : 4px;
  flex-shrink : 0;
}

/* Actions (Apply/Reset) — ancrés en bas, toujours visibles (req. JP) */
.af-filters__actions {
  padding    : 10px 16px 12px;
  border-top : 1px solid #E0E0E0;
  display    : flex;
  gap        : 8px;
  justify-content: flex-end;
  position   : sticky;
  bottom     : 0;
  background : var(--aa-bg, #fff);
  z-index    : 2;
}
@media (max-width: 767px) {
  .af-filters__section-body--row { flex-direction: column !important; }
  .af-filters__actions { justify-content: stretch; }
  .af-filters__btn { flex: 1; }
}

/* Mobile */
@media (max-width: 767px) {
  .af-filters__row { gap: 8px; }
  .af-filters__group { min-width: calc(50% - 4px); flex: 1 1 calc(50% - 4px); }
  .af-filters__group--check { min-width: 100%; flex: 1 1 100%; }
  .af-filters__actions { justify-content: stretch; }
  .af-filters__btn { flex: 1; }
}

/* ── Live Artist Search Box (Task #42) ──────────────────────────────────── */
.africart-search-box {
  padding    : 24px 20px 20px;
  display    : flex;
  flex-direction: column;
  align-items: center;
  gap        : 12px;
}
.africart-search-box__inner {
  position   : relative;
  width      : 100%;
  max-width  : 520px;
}
.africart-search-box__input {
  width          : 100%;
  padding        : 13px 16px 13px 42px;
  border         : 1.5px solid var(--aa-border);
  border-radius  : 8px;
  font-size      : 15px;
  box-sizing     : border-box;
  outline        : none;
  transition     : border-color .2s, box-shadow .2s;
  background     : #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2378909C' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 13px center;
  background-size: 16px;
}
.africart-search-box__input:focus {
  border-color: var(--aa-blue);
  box-shadow  : 0 0 0 3px rgba(21,101,192,.12);
}
.africart-search-box__dropdown {
  position     : absolute;
  top          : calc(100% + 4px);
  left         : 0;
  right        : 0;
  z-index      : 9999;
  background   : #fff;
  border       : 1px solid var(--aa-border);
  border-radius: 8px;
  box-shadow   : 0 4px 20px rgba(0,0,0,.12);
  list-style   : none;
  margin       : 0;
  padding      : 4px 0;
  max-height   : min(52vh, 360px);
  overflow-y   : auto;
  scrollbar-width: thin;
  scrollbar-color: var(--aa-blue) #eef2f5;
}
.africart-search-box__dropdown::-webkit-scrollbar,
.af-filters__artist-dropdown::-webkit-scrollbar { width: 10px; }
.africart-search-box__dropdown::-webkit-scrollbar-track,
.af-filters__artist-dropdown::-webkit-scrollbar-track { background: #eef2f5; border-radius: 8px; }
.africart-search-box__dropdown::-webkit-scrollbar-thumb,
.af-filters__artist-dropdown::-webkit-scrollbar-thumb { background: var(--aa-blue); border-radius: 8px; border: 2px solid #eef2f5; }
.af-filters__artist-dropdown { max-height: min(52vh, 360px) !important; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--aa-blue) #eef2f5; }
.africart-search-box__dropdown[hidden] { display: none; }
.africart-search-box__item {
  padding        : 11px 16px;
  cursor         : pointer;
  font-size      : 14px;
  color          : var(--aa-text);
  transition     : background .12s;
  user-select    : none;
  -webkit-user-select: none;
}
.africart-search-box__item:hover,
.africart-search-box__item:focus {
  background: var(--aa-bg);
  outline   : none;
}
.africart-search-box__scroll-hint {
  position: sticky;
  bottom: 0;
  padding: 6px 12px;
  background: rgba(247,250,252,.96);
  border-top: 1px solid var(--aa-border);
  color: var(--aa-text-light);
  font-size: 11px;
  text-align: center;
  pointer-events: none;
}
.africart-search-box__hint {
  font-size : 13px;
  color     : var(--aa-text-light);
  text-align: center;
  margin    : 0;
}

/* La boîte interactive réelle mesure 48×48px ; le cercle visible reste compact. */
.africart-info-btn { position : relative; }

/* Centrage vertical dans pill/badge */
.africart-pill .africart-info-wrap,
.africart-meta .africart-info-wrap {
  align-self   : center;
  margin-top   : 0;
  margin-bottom: 0;
}

@media (max-width: 767px) {
  /* touch already handled above */

  /* Prevent horizontal overflow on charts/env-selector */
  .africart-widget {
    overflow-x : hidden;
  }
  .africart-env-selector {
    overflow-x      : auto;
    scrollbar-width : none;
    -ms-overflow-style: none;
    padding-bottom  : 2px;
  }
  .africart-env-selector::-webkit-scrollbar { display: none; }
  .africart-env-btn {
    white-space : nowrap;
    flex-shrink : 0;
  }

  /* Search box on mobile */
  .africart-search-box {
    padding: 16px 12px 14px;
  }
  .africart-search-box__input {
    font-size: 16px; /* prevents iOS zoom on focus */
  }
  .africart-search-box__item {
    padding: 14px 16px; /* bigger tap target */
  }
}

/* ── PDF Export Button (v2.4.0) ──────────────────────────────────────────── */
.africart-pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  background: transparent;
  border: 1.5px solid #8C6239;
  border-radius: 6px;
  color: #8C6239;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  white-space: nowrap;
  margin-left: auto;
  flex-shrink: 0;
}
.africart-pdf-btn:hover {
  background: #8C6239;
  color: #fff;
}
.africart-pdf-btn:hover svg { stroke: #fff; }
.africart-pdf-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}
.africart-pdf-btn svg {
  stroke: #8C6239;
  flex-shrink: 0;
  transition: stroke 0.18s;
}
/* Make africart-meta row flex so button floats right */
.africart-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

/* ── Bandeau transparence indexation (pré-Paywall) ─────────────────────── */
.africart-index-banner {
  display        : flex;
  align-items    : center;
  gap            : 8px;
  width          : 100%;
  margin-top     : 10px;
  padding        : 8px 12px;
  background     : linear-gradient(135deg, #faf6f0 0%, #f5ede0 100%);
  border         : 1px solid #e8d5b8;
  border-left    : 3px solid #8C6239;
  border-radius  : 6px;
  box-sizing     : border-box;
}
.africart-index-banner__icon {
  flex-shrink    : 0;
  color          : #8C6239;
  opacity        : 0.85;
}
.africart-index-banner__text {
  font-size      : 11.5px;
  line-height    : 1.4;
  color          : #6b4a2e;
  font-style     : italic;
}
@media (max-width: 480px) {
  .africart-index-banner {
    padding      : 6px 10px;
  }
  .africart-index-banner__text {
    font-size    : 11px;
  }
}

/* ── Suppression bandeau + pills KPI (v2.6.0 – demande client) ─────────────── */
.africart-meta          { display: none !important; }
.africart-index-banner  { display: none !important; }


/* ── v2.7.5 "Affiner" toggle — aligné comme les section-hdr ─────────────── */
.af-filters__refine-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px 16px;
  color: #546E7A;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  width: 100%;
  text-align: left;
  border-top: 1px solid #E0E0E0;
}
.af-filters__refine-toggle:hover { color: #263238; }
.af-filters__refine-chevron {
  width: 14px; height: 14px;
  transition: transform .2s;
  flex-shrink: 0;
}
.af-filters__refine-toggle--open .af-filters__refine-chevron {
  transform: rotate(180deg);
}
.af-filters__advanced {
  /* hidden by default via [hidden] attribute */
}

/* ── M2 v2.8.0 — Widget Footer (Lang / Currency / Unit / Tour) ────────────── */
/* ── Controls Bar (v2.9.0 — currency / unit / guide, sits between header and env tabs) ── */
.africart-controls-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 16px 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid #EEEBE7;
  background: #FDFAF7;
}

.africart-widget-footer {
  display: none; /* footer removed in v2.9.0 — controls moved to africart-controls-bar */
}
.africart-footer-group {
  display: flex;
  gap: 4px;
  align-items: center;
}
.africart-footer-sep {
  width: 1px;
  height: 18px;
  background: #DDD;
  margin: 0 4px;
}
.africart-footer-btn {
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
  border: 1px solid #C9C0B6;
  border-radius: 12px;
  background: #fff;
  color: #7A6A5A;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  line-height: 1.4;
}
.africart-footer-btn:hover {
  background: #F0EAE3;
  border-color: #8C6239;
  color: #5A3E28;
}
.africart-footer-btn.is-active {
  background: #8C6239;
  border-color: #8C6239;
  color: #fff;
}
.africart-tour-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  border: 1px dashed #8C6239;
  border-radius: 12px;
  background: #FFF9F5;
  color: #8C6239;
  cursor: pointer;
  transition: background .15s;
}
.africart-tour-btn:hover {
  background: #F0EAE3;
}
/* Intro.js theme override */
.introjs-tooltip {
  border-radius: 8px !important;
  box-shadow: 0 8px 32px rgba(0,0,0,.18) !important;
  font-family: inherit !important;
}
.introjs-button {
  border-radius: 6px !important;
  font-weight: 600 !important;
  font-size: 13px !important;
}
.introjs-nextbutton {
  background: #8C6239 !important;
  border-color: #8C6239 !important;
  color: #fff !important;
}
.introjs-nextbutton:hover {
  background: #6E4C2D !important;
}

/* ──────────────────────────────────────────────────────────────────────────────
   Intro.js — Mobile responsive overrides  (v2.9.2)
   Fix: overlay full-screen, tooltip width, skip-button position on iOS Safari
────────────────────────────────────────────────────────────────────────────── */
.introjs-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 999998 !important;
}
.introjs-fixedTooltip .introjs-tooltip,
.introjs-tooltip {
  max-width: min(420px, calc(100vw - 24px)) !important;
  min-width: 260px;
  word-break: break-word;
}
.introjs-skipbutton {
  display: block !important;
  position: static !important;
  text-align: right !important;
  padding: 4px 0 0 !important;
  font-size: 12px !important;
  color: #8C6239 !important;
  white-space: nowrap !important;
}
@media (max-width: 767px) {
  .introjs-tooltip {
    max-width: calc(100vw - 24px) !important;
    font-size: 13px !important;
    padding: 16px !important;
  }
  .introjs-tooltiptext {
    font-size: 13px !important;
    line-height: 1.5 !important;
  }
  .introjs-tooltipbuttons {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  .introjs-button {
    font-size: 12px !important;
    padding: 6px 12px !important;
    flex: 1 1 auto !important;
  }
  .introjs-skipbutton {
    font-size: 11px !important;
    order: -1 !important;
    flex: 0 0 100% !important;
    text-align: right !important;
    white-space: nowrap !important;
  }
  .introjs-helperLayer {
    box-shadow: rgba(33,33,33,.8) 0 0 1px 2px, rgba(33,33,33,.5) 0 0 0 5000px !important;
  }
}
