/* ============================================================
   Bons Plans Madagascar — Style principal
   ============================================================ */

:root {
  --primary: #FF5A3C;
  --primary-dark: #E8491F;
  --secondary: #1A2B4C;
  --accent: #FFC93C;
  --bg: #F7F8FA;
  --card-bg: #FFFFFF;
  --text: #1E1E24;
  --text-muted: #6B7280;
  --radius: 14px;
  --shadow: 0 4px 16px rgba(20, 20, 40, 0.08);
  --shadow-hover: 0 10px 28px rgba(20, 20, 40, 0.14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

a { text-decoration: none; color: inherit; }

h1, h2, h3, h4 { margin: 0 0 10px; font-weight: 700; }

/* Header */
.site-header {
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  gap: 16px;
}
.logo { font-size: 1.3rem; font-weight: 800; color: var(--secondary); display: flex; align-items: center; }
.logo-img { height: 64px; width: auto; display: block; }
.main-nav { display: flex; gap: 22px; flex: 1; justify-content: center; }
.main-nav a { font-weight: 600; color: var(--text-muted); }
.main-nav a:hover { color: var(--primary); }
.btn-propose { white-space: nowrap; }
.nav-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-light { background: #fff; color: var(--secondary); }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--secondary), #2A407A);
  color: #fff;
  padding: 60px 0 70px;
  text-align: center;
}
.hero h1 { font-size: 2.1rem; max-width: 700px; margin: 0 auto 12px; }
.hero-subtitle { color: #C9D3EA; margin-bottom: 28px; }
.search-bar {
  display: flex;
  gap: 0;
  max-width: 640px;
  margin: 0 auto;
  background: #fff;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.search-bar input, .search-bar select {
  border: none;
  padding: 14px 16px;
  font-size: 0.95rem;
  outline: none;
}
.search-bar input { flex: 1; }
.search-bar .btn { border-radius: 0; }

/* Category chips */
.category-chips {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 20px;
  margin-top: -30px;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}
.category-chips::-webkit-scrollbar { display: none; } /* Chrome/Safari/Opera */
.chip {
  background: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.9rem;
}

/* Sections & grid */
.section { padding: 30px 20px; }
.deals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}
.empty-state { color: var(--text-muted); text-align: center; padding: 30px; }
.section-more { text-align: center; margin-top: 20px; }
.btn-outline { display: inline-block; padding: 10px 24px; border-radius: 999px; border: 2px solid var(--primary); color: var(--primary); font-weight: 700; background: transparent; }
.btn-outline:hover { background: var(--primary); color: #fff; }

/* Deal card */
.deal-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
  display: block;
}
.deal-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.deal-card-img {
  height: 170px;
  background-size: cover;
  background-position: center;
  position: relative;
  background-color: #eee;
}
.badge-discount {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
}
.badge-category {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255,255,255,0.9);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.deal-card-body { padding: 14px 16px 16px; }
.deal-card-body h3 { font-size: 1.02rem; margin-bottom: 4px; }
.deal-business { color: var(--text-muted); font-size: 0.85rem; margin: 0 0 8px; }
.deal-price { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.old-price { text-decoration: line-through; color: var(--text-muted); font-size: 0.85rem; }
.new-price { color: var(--primary); font-weight: 800; font-size: 1.1rem; }
.deal-meta { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-muted); }

/* CTA band */
.cta-band {
  background: var(--accent);
  text-align: center;
  padding: 40px 20px;
  margin-top: 30px;
}
.cta-band h2 { color: var(--secondary); }

/* Footer */
.site-footer { background: var(--secondary); color: #C9D3EA; padding: 40px 0 0; margin-top: 40px; }
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 30px;
  padding-bottom: 30px;
}
.footer-col h3, .footer-col h4 { color: #fff; }
.footer-col a { display: block; color: #C9D3EA; padding: 4px 0; }
.footer-bottom {
  text-align: center;
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.85rem;
}

/* Forms (public + admin) */
.form-page { max-width: 640px; margin: 40px auto; padding: 0 20px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #E0E2E8;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Photo gallery */
.photo-gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.photo-gallery-thumbs .thumb { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; cursor: pointer; opacity: 0.6; border: 2px solid transparent; flex-shrink: 0; }
.photo-gallery-thumbs .thumb.active, .photo-gallery-thumbs .thumb:hover { opacity: 1; border-color: var(--primary); }

/* Ad carousel */
.promo-carousel { position: relative; width: 100%; max-width: 1180px; margin: 20px auto 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); box-sizing: border-box; background: var(--secondary); }
.promo-slide { display: none; position: relative; width: 100%; }
.promo-slide.active { display: block; }
.promo-slide a { display: block; width: 100%; height: 100%; }
.promo-slide img, .promo-slide video {
  display: block;
  width: 100%;
  height: 260px;
  max-width: 100%;
  object-fit: cover;
  object-position: center;
}
.promo-slide-label { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,0.55); color: #fff; font-size: 0.7rem; padding: 3px 10px; border-radius: 999px; letter-spacing: 0.03em; }
.promo-carousel-dots { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.promo-carousel-dots span { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.6); cursor: pointer; }
.promo-carousel-dots span.active { background: #fff; }
@media (max-width: 700px) {
  .promo-slide img, .promo-slide video { height: 180px; }
}

/* Detail page */
.deal-detail { max-width: 800px; margin: 30px auto; padding: 0 20px; }
.deal-detail-img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); max-height: 420px; object-fit: cover; }
.deal-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0; }

/* Admin */
.admin-body { background: #F1F3F8; min-height: 100vh; }
.admin-wrap { display: flex; min-height: 100vh; }
.admin-sidebar { width: 220px; background: var(--secondary); color: #fff; padding: 20px; }
.admin-sidebar a { display: block; color: #C9D3EA; padding: 10px 0; font-weight: 600; }
.admin-sidebar a:hover, .admin-sidebar a.active { color: #fff; }
.admin-main { flex: 1; padding: 30px; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 16px; margin-bottom: 30px; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat-card .num { font-size: 1.6rem; font-weight: 800; color: var(--primary); }
.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.admin-table th, .admin-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #EEE; font-size: 0.9rem; }
.admin-table th { background: #FAFBFC; }
.status-tag { padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; }
.status-active { background: #E3F9E5; color: #1B8A3D; }
.status-expired { background: #FDEAEA; color: #C0392B; }
.status-upcoming { background: #FFF4D6; color: #B7791F; }
.admin-login-box { max-width: 380px; margin: 80px auto; background: #fff; padding: 30px; border-radius: var(--radius); box-shadow: var(--shadow); }

/* Responsive */
@media (max-width: 800px) {
  .main-nav { position: absolute; top: 100%; left: 0; right: 0; background: #fff; flex-direction: column; padding: 10px 20px; display: none; box-shadow: var(--shadow); }
  .main-nav.open { display: flex; }
  .nav-toggle { display: block; }
  .btn-propose { display: none; }
  .search-bar { flex-direction: column; border-radius: var(--radius); }
  .footer-inner { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .admin-sidebar { width: 70px; }
  .admin-sidebar span.label { display: none; }

  /* Grille 2 colonnes sur mobile, cartes compactes */
  .deals-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .deal-card-img { height: 110px; }
  .deal-card-body { padding: 10px 12px 12px; }
  .deal-card-body h3 { font-size: 0.88rem; line-height: 1.25; }
  .deal-business { font-size: 0.75rem; margin-bottom: 6px; }
  .deal-price { gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
  .old-price { font-size: 0.72rem; }
  .new-price { font-size: 0.92rem; }
  .deal-meta { font-size: 0.7rem; flex-direction: column; align-items: flex-start; gap: 2px; }
  .badge-discount, .badge-category { font-size: 0.68rem; padding: 3px 8px; }
  .section { padding: 24px 14px; }
  .section h2 { font-size: 1.15rem; }
}
