/* ================================================================
   ESTIMATEUR DE PRIX - STYLE DÉTAILS ANNONCE
   baniola.tn
   ================================================================ */

/* ─────────────────────────────────────────────────────────────────
   VARIABLES
   ───────────────────────────────────────────────────────────────── */
:root {
  --est-primary: #0f53ff;
  --est-primary-light: #eef3ff;
  --est-success: #16a34a;
  --est-success-light: #dcfce7;
  --est-warning: #d97706;
  --est-warning-light: #fef3c7;
  --est-danger: #dc2626;
  --est-danger-light: #fee2e2;
  --est-neutral: #64748b;
  --est-neutral-light: #f1f5f9;
  --est-bg: #ffffff;
  --est-border: #e2e8f0;
  --est-text: #0f172a;
  --est-text-muted: #64748b;
  --est-radius: 12px;
  --est-radius-sm: 8px;
  --est-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
  --est-shadow-hover: 0 4px 20px rgba(15, 23, 42, 0.12);
}

/* ─────────────────────────────────────────────────────────────────
   WIDGET PRINCIPAL
   ───────────────────────────────────────────────────────────────── */
.est-widget {
  background: var(--est-bg);
  border: 1px solid var(--est-border);
  border-radius: var(--est-radius);
  padding: 20px;
  margin: 16px 0;
  box-shadow: var(--est-shadow);
  transition: box-shadow 0.3s ease;
}

.est-widget:hover {
  box-shadow: var(--est-shadow-hover);
}

/* ─────────────────────────────────────────────────────────────────
   EN-TÊTE
   ───────────────────────────────────────────────────────────────── */
.est-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--est-border);
}

.est-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.est-icon {
  width: 24px;
  height: 24px;
  color: var(--est-primary);
  flex-shrink: 0;
}

.est-header-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--est-text);
}

.est-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.est-badge--success {
  background: var(--est-success-light);
  color: var(--est-success);
}

.est-badge--info {
  background: var(--est-primary-light);
  color: var(--est-primary);
}

.est-badge--warning {
  background: var(--est-warning-light);
  color: var(--est-warning);
}

/* ─────────────────────────────────────────────────────────────────
   INFO COHORTE
   ───────────────────────────────────────────────────────────────── */
.est-cohort-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.est-cohort-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--est-neutral-light);
  border-radius: var(--est-radius-sm);
  font-size: 12px;
  color: var(--est-text-muted);
  font-weight: 500;
}

.est-cohort-chip--warn {
  background: var(--est-warning-light);
  color: var(--est-warning);
}

.est-cohort-chip svg {
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────────────────
   HERO PRIX — MOBILE FIRST (base = smartphone)
   ───────────────────────────────────────────────────────────────── */
.est-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 7px;
  padding: 16px 14px;
  margin-bottom: 14px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  border: 1px solid var(--est-border);
  border-radius: var(--est-radius);
  overflow: hidden;
}

/* Accent coloré en haut selon le verdict */
.est-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.est-hero--good::before     { background: var(--est-success); }
.est-hero--fair::before     { background: var(--est-primary); }
.est-hero--high::before     { background: var(--est-warning); }
.est-hero--veryhigh::before { background: var(--est-danger); }

.est-hero-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--est-text-muted);
}

.est-hero-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
}

.est-price-value {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--est-text);
  line-height: 1;
}

.est-price-cur {
  font-size: 16px;
  font-weight: 700;
  color: var(--est-text-muted);
}

/* Verdict = pill colorée avec pastille */
.est-hero-verdict {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.est-verdict-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.est-hero-verdict--good {
  color: var(--est-success);
  background: var(--est-success-light);
}

.est-hero-verdict--fair {
  color: var(--est-primary);
  background: var(--est-primary-light);
}

.est-hero-verdict--high {
  color: var(--est-warning);
  background: var(--est-warning-light);
}

.est-hero-verdict--veryhigh {
  color: var(--est-danger);
  background: var(--est-danger-light);
}

.est-hero-desc {
  font-size: 12px;
  color: var(--est-text-muted);
  line-height: 1.45;
  max-width: 36ch;
}

/* ─────────────────────────────────────────────────────────────────
   NOTE INDICATIVE (cohorte faible)
   ───────────────────────────────────────────────────────────────── */
.est-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  background: var(--est-warning-light);
  color: var(--est-warning);
  border-radius: var(--est-radius-sm);
  font-size: 12.5px;
  font-weight: 500;
}

.est-note svg {
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────────────────
   FOURCHETTE DE PRIX MARCHÉ (style sites pro)
   ───────────────────────────────────────────────────────────────── */
.est-range {
  padding: 16px;
  background: #f8fafc;
  border: 1px solid var(--est-border);
  border-radius: var(--est-radius-sm);
  margin-bottom: 20px;
}

.est-range-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 16px;
}

.est-range-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--est-text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.est-range-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--est-primary);
}

.est-bar-section {
  margin-bottom: 0;
}

.est-bar-simple {
  position: relative;
  height: 10px;
  background: #e2e8f0;
  border-radius: 5px;
  margin-bottom: 10px;
}

.est-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #16a34a 0%, #84cc16 35%, #d97706 75%, #dc2626 100%);
  border-radius: 5px;
}

.est-bar-marker {
  position: absolute;
  top: -5px;
  width: 20px;
  height: 20px;
  background: #ffffff;
  border: 4px solid #0f53ff;
  border-radius: 50%;
  transform: translateX(-50%);
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: left 0.5s ease;
}

.est-bar-marker--good {
  border-color: #16a34a;
}

.est-bar-marker--fair {
  border-color: #0f53ff;
}

.est-bar-marker--high {
  border-color: #d97706;
}

.est-bar-marker--veryhigh {
  border-color: #dc2626;
}

.est-bar-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--est-text-muted);
  margin-top: 4px;
}

.est-bar-labels span {
  font-weight: 500;
}

.est-bar-labels .est-bar-current {
  font-weight: 700;
  color: var(--est-text);
}

/* ─────────────────────────────────────────────────────────────────
   VERDICT SIMPLIFIÉ
   ───────────────────────────────────────────────────────────────── */
.est-verdict {
  text-align: center;
  padding: 16px;
  background: #f8fafc;
  border-radius: var(--est-radius-sm);
  margin-bottom: 20px;
  border: 1px solid var(--est-border);
}

.est-verdict-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.est-verdict-title--good {
  color: #16a34a;
}

.est-verdict-title--fair {
  color: #0f53ff;
}

.est-verdict-title--high {
  color: #d97706;
}

.est-verdict-title--veryhigh {
  color: #dc2626;
}

.est-verdict-text {
  font-size: 14px;
  color: var(--est-text-muted);
}

/* ─────────────────────────────────────────────────────────────────
   STATISTIQUES — MOBILE FIRST (2 colonnes dès le mobile)
   ───────────────────────────────────────────────────────────────── */
.est-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 4px;
}

.est-stat-box {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  background: #f8fafc;
  border-radius: var(--est-radius-sm);
  border: 1px solid var(--est-border);
}

.est-stat-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--est-primary-light);
  color: var(--est-primary);
  flex-shrink: 0;
}

.est-stat-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.est-stat-label {
  font-size: 11px;
  color: var(--est-text-muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.est-stat-value {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--est-text);
  white-space: nowrap;
}

/* ─────────────────────────────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────────────────────────────── */
.est-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--est-border);
  font-size: 12px;
  color: var(--est-text-muted);
}

.est-footer span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.est-footer strong {
  color: var(--est-text);
  font-weight: 600;
}

/* ─────────────────────────────────────────────────────────────────
   ALERT
   ───────────────────────────────────────────────────────────────── */
.est-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--est-radius-sm);
  margin-bottom: 16px;
}

.est-alert--warning {
  background: var(--est-warning-light);
  color: var(--est-warning);
}

.est-alert--info {
  background: var(--est-primary-light);
  color: var(--est-primary);
}

.est-alert--danger {
  background: var(--est-danger-light);
  color: var(--est-danger);
}

.est-alert svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.est-alert div {
  flex: 1;
  font-size: 13px;
}

.est-alert strong {
  font-weight: 600;
}

/* ─────────────────────────────────────────────────────────────────
   RESPONSIVE — MOBILE FIRST
   Base = mobile (ci-dessus). On AGRANDIT à partir de 768px.
   ───────────────────────────────────────────────────────────────── */

/* Très petits écrans : en-tête empilé */
@media (max-width: 380px) {
  .est-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .est-badge {
    align-self: flex-start;
  }
}

/* Tablette et desktop : on agrandit le widget */
@media (min-width: 768px) {
  .est-widget {
    padding: 24px;
  }

  .est-hero {
    gap: 9px;
    padding: 24px 20px;
    margin-bottom: 18px;
  }

  .est-price-value {
    font-size: 40px;
  }

  .est-price-cur {
    font-size: 18px;
  }

  .est-hero-verdict {
    font-size: 14px;
  }

  .est-hero-desc {
    font-size: 13px;
  }

  .est-stats {
    gap: 12px;
  }

  .est-stat-box {
    padding: 12px 14px;
  }

  .est-stat-label {
    font-size: 12px;
  }

  .est-stat-value {
    font-size: 15px;
  }
}
