/* ============================================================
   BABAIVOIRE — DESIGN SYSTEM
   Palette : Navy premium + Cuivre (copper) accent
   Typo    : Sora (titres) + Inter (texte)
   ============================================================ */

:root {
  /* Couleurs de marque */
  --navy:        #182848;
  --navy-deep:   #0F1B33;
  --navy-soft:   #2A3D66;
  --copper:      #C4762B;
  --copper-dark: #A25F20;
  --copper-soft: #F3E3D0;

  /* Neutres chauds */
  --ink:         #16181F;
  --ink-soft:    #565E6D;
  --muted:       #8992A3;
  --bg:          #F7F5F1;
  --card-bg:     #FFFFFF;
  --border:      #E7E2D8;
  --border-soft: #EDEAE2;

  /* États */
  --success:     #1E8A5B;
  --success-bg:  #E7F5EE;
  --danger:      #C0392B;
  --danger-bg:   #FBEAE7;

  --radius:      14px;
  --radius-sm:   10px;
  --shadow:      0 3px 16px rgba(15, 27, 51, .07);
  --shadow-lg:   0 10px 30px rgba(15, 27, 51, .12);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
button { font-family: inherit; }

h1, h2, h3, .font-display {
  font-family: 'Sora', sans-serif;
}

/* ============ TOPBAR ============ */
.sticky-shell {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--navy);
  box-shadow: 0 4px 18px rgba(15, 27, 51, .18);
}

.topbar {
  background: var(--navy);
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  justify-content: space-between;
}

.topbar-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.3px;
  color: #fff;
  display: flex;
  align-items: center;
}

.logo span { color: var(--copper); }

.logo-dot {
  width: 6px; height: 6px;
  background: var(--copper);
  border-radius: 50%;
  display: inline-block;
  margin-left: 4px;
}

.nav-links { display: none; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-icon-link {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(255,255,255,.85);
  padding: 6px 8px;
  border-radius: 8px;
}

.nav-icon-link svg { width: 18px; height: 18px; stroke: currentColor; flex-shrink: 0; }
.nav-icon-link:active { background: rgba(255,255,255,.1); }

.btn-sell {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy-deep);
  background: var(--copper);
  padding: 8px 14px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* ============ SEARCHBAR ============ */
.searchbar {
  background: var(--navy);
  padding: 0 12px 12px;
}

.searchbar-inner {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 13px;
  color: var(--muted);
  pointer-events: none;
  display: flex;
}
.search-icon svg { width: 16px; height: 16px; }

.search-input {
  width: 100%;
  height: 42px;
  background: #fff;
  border: none;
  border-radius: 22px;
  padding: 0 100px 0 38px;
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  color: var(--ink);
  outline: none;
}

.search-input::placeholder { color: #A6ADB8; }

.search-btn {
  position: absolute;
  right: 4px;
  height: 34px;
  padding: 0 15px;
  background: var(--copper);
  border: none;
  border-radius: 18px;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.search-filters { display: none; }

/* ============ MAIN CONTAINER ============ */
.container { padding: 14px 12px 90px; }

.section { margin-bottom: 24px; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 0 2px;
}

.section-title {
  font-family: 'Sora', sans-serif;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
}

.section-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--copper-dark);
}

/* ============ SLIDER (catégories / boutiques / nouveautés) ============ */
.slider {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.slider::-webkit-scrollbar { display: none; }

.card {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
  scroll-snap-align: start;
  flex-shrink: 0;
  width: 112px;
  border: 1px solid var(--border-soft);
}

.card-media {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media.shop-img img { object-fit: contain; padding: 8px; }
.card-media.cat img { object-fit: contain; padding: 10px; }
.card-media.new-img img { object-fit: cover; }

.card-media.empty { color: var(--muted); font-size: 9px; flex-direction: column; gap: 3px; }
.card-media.empty::before { content: '🖼'; font-size: 18px; opacity: .35; }

.card-body { padding: 8px 8px 9px; }

.card-title {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.card-sub {
  font-size: 9.5px;
  color: var(--copper-dark);
  font-weight: 600;
}

.price-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.price { font-size: 12px; font-weight: 800; color: var(--navy); }
.old-price { font-size: 9.5px; color: #B7BEC9; text-decoration: line-through; }

.card.new-card { width: 122px; }

/* ============ PRODUCT GRID ============ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.product-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
}

.product-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bg);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-image img { width: 100%; height: 100%; object-fit: cover; }

.product-image.empty { color: var(--muted); font-size: 11px; flex-direction: column; gap: 4px; }
.product-image.empty::before { content: '📦'; font-size: 24px; opacity: .35; }

.product-body { padding: 9px 10px 11px; display: flex; flex-direction: column; flex: 1; }

.product-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price-row { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.product-price { font-size: 14.5px; font-weight: 800; color: var(--navy); letter-spacing: -.3px; }
.product-old-price { font-size: 11px; color: #B7BEC9; text-decoration: line-through; }

.product-badge {
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  background: var(--copper);
  padding: 2px 7px;
  border-radius: 20px;
  text-transform: uppercase;
}

/* ============ ETAT VIDE ============ */
.empty-box {
  background: var(--card-bg);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.empty-box::before { content: '🔍'; display: block; font-size: 28px; margin-bottom: 10px; opacity: .5; }

/* ============ BOUTONS GENERIQUES ============ */
.btn {
  height: 50px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--navy);
  font-size: 14.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-outline { background: #fff; color: var(--navy); }
.btn-primary { background: var(--copper); color: #fff; border-color: var(--copper); box-shadow: 0 4px 14px rgba(196,118,43,.3); }

/* ============ FOOTER ============ */
.footer { background: var(--card-bg); padding: 22px 16px; border-top: 1px solid var(--border-soft); margin-top: 10px; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.footer-logo { font-family: 'Sora', sans-serif; font-size: 15px; font-weight: 700; color: var(--navy); }
.footer-logo span { color: var(--copper); }
.footer-links { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.footer-links a { font-size: 12px; color: var(--ink-soft); font-weight: 500; }
.footer-copy { font-size: 11px; color: var(--muted); }

/* ============ MENU BAS MOBILE ============ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 64px;
  background: #fff;
  border-top: 1px solid var(--border-soft);
  box-shadow: 0 -6px 22px rgba(15,27,51,.10);
  z-index: 500;
  align-items: center;
  justify-content: space-around;
  padding: 0 4px;
}

@media (max-width: 480px) {
  .bottom-nav { display: flex; }
  .container { padding-bottom: 84px; }
  .footer { margin-bottom: 64px; }
}

.bn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  height: 100%;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  position: relative;
}
.bn-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bn-item:active { transform: scale(.93); }
.bn-item.active { color: var(--copper-dark); }
.bn-item.active .bn-icon { stroke: var(--copper-dark); }
.bn-item.active::before {
  content: '';
  position: absolute;
  top: 0; left: 22%; right: 22%;
  height: 2.5px;
  background: var(--copper);
  border-radius: 0 0 3px 3px;
}
.bn-icon { width: 20px; height: 20px; stroke: #C3C9D3; transition: stroke .2s; flex-shrink: 0; }

.bn-cart-wrap { position: relative; display: flex; align-items: center; justify-content: center; }
.bn-cart-badge {
  position: absolute; top: -5px; right: -8px;
  min-width: 16px; height: 16px;
  background: var(--danger); color: #fff;
  border-radius: 999px; font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; border: 1.5px solid #fff;
}

/* ============ DESKTOP ============ */
@media (min-width: 481px) {
  body { max-width: 100%; }
  .container { max-width: 1280px; margin: 0 auto; padding: 22px 24px 60px; }
  .topbar { padding: 0 24px; }
  .searchbar { padding: 0 24px 14px; }
  .nav-links { display: flex; gap: 4px; }
  .nav-links a { font-size: 13px; font-weight: 600; color: rgba(255,255,255,.75); padding: 8px 13px; border-radius: 8px; }
  .nav-links a:hover, .nav-links a.active { color: #fff; background: rgba(255,255,255,.08); }
  .search-filters { display: flex; gap: 8px; flex-shrink: 0; }
  .filter-chip {
    font-size: 12px; font-weight: 600; color: #fff;
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
    padding: 7px 13px; border-radius: 20px; cursor: pointer; white-space: nowrap;
  }
  .filter-chip:hover { background: rgba(255,255,255,.18); }
  .products-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .card { width: 145px; }
  .card.new-card { width: 165px; }
  .footer-inner { flex-direction: row; justify-content: space-between; text-align: left; }
}
