/* ============================================================
   Niger Laptops – Styles PWA
   Palette : Désert, Fleuve Niger & Drapeau Nigérien
   ============================================================ */

/* ---------- RESET & VARIABLES ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Couleurs principales */
  --orange:      #E05206;   /* drapeau nigérien */
  --orange-dark: #B84504;
  --green:       #0CAB3A;   /* drapeau nigérien */
  --green-dark:  #088A2E;
  --white:       #FFFFFF;

  /* Désert (sable / ocre) */
  --sand-light:  #FDF6EC;
  --sand:        #F5E6D3;
  --sand-dark:   #D4B68C;
  --sand-text:   #5C3D2E;   /* brun sable */

  /* Fleuve Niger (bleu profond) */
  --river:       #1B6B93;
  --river-dark:  #0E4B6A;
  --river-light: #4A90E2;

  /* Fond et surface */
  --bg:          var(--sand-light);
  --surface:     #FFFFFF;
  --surface-alt: #FEF9F3;

  /* Texte */
  --text:        #2B2B2B;
  --text-light:  #6B5B4F;
  --text-muted:  #A09080;

  /* Bordures et ombres */
  --border:      #E8DDD1;
  --shadow-sm:   0 2px 8px rgba(0,0,0,0.04);
  --shadow-md:   0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:   0 8px 24px rgba(0,0,0,0.12);
  --shadow-xl:   0 12px 32px rgba(0,0,0,0.16);

  /* Rayons */
  --radius-sm:  8px;
  --radius:     14px;
  --radius-lg:  20px;
  --radius-xl:  28px;

  /* Transitions */
  --ease:       0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --ease-fast:  0.15s ease;
}

/* ---------- BASE ---------- */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

/* ---------- TYPOGRAPHIE ---------- */
h1, h2, h3, h4 {
  line-height: 1.3;
  font-weight: 700;
}

h1 { font-size: 1.8rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p {
  margin-bottom: 0.8rem;
}

small, .text-small {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* ---------- BOUTONS UX DE DERNIÈRE GÉNÉRATION ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  cursor: pointer;
  transition: all var(--ease-fast);
  position: relative;
  overflow: hidden;
  outline: none;
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
}

/* Effet ripple (onde au clic) */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,0.3) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.btn:active::after {
  opacity: 1;
  transition: opacity 0s;
}

/* Variantes */
.btn-primary {
  background: var(--orange);
  color: white;
  border-color: var(--orange);
  box-shadow: 0 4px 12px rgba(224, 82, 6, 0.3);
}

.btn-primary:hover {
  background: var(--orange-dark);
  border-color: var(--orange-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(224, 82, 6, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(224, 82, 6, 0.2);
}

.btn-primary:focus-visible {
  box-shadow: 0 0 0 3px rgba(224, 82, 6, 0.4);
}

.btn-secondary {
  background: var(--green);
  color: white;
  border-color: var(--green);
  box-shadow: 0 4px 12px rgba(12, 171, 58, 0.2);
}

.btn-secondary:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(12, 171, 58, 0.3);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--orange);
  color: var(--orange);
}

.btn-outline:hover {
  background: var(--orange);
  color: white;
  transform: translateY(-2px);
}

.btn-danger {
  background: #D32F2F;
  color: white;
  border-color: #D32F2F;
}

.btn-danger:hover {
  background: #B71C1C;
  border-color: #B71C1C;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---------- CARTES ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: box-shadow var(--ease);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

/* ---------- FORMULAIRES ---------- */
input,
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--ease), box-shadow var(--ease);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(224, 82, 6, 0.15);
}

/* ---------- LAYOUT ---------- */
.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem 1rem;
}

.flex {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
.text-center { text-align: center; }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--orange);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 50px;
  padding: 0.2em 0.6em;
  min-width: 1.6em;
  line-height: 1;
}

/* ---------- GRILLE PRODUITS ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.product-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform var(--ease), box-shadow var(--ease);
  border: 1px solid var(--border);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.product-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: var(--sand);
}

.product-info {
  padding: 0.75rem;
}

.product-info h4 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.price {
  font-weight: 700;
  color: var(--orange);
  font-size: 1.1rem;
}

.old-price {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 0.5rem;
}

/* ---------- HEADER DYNAMIQUE ---------- */
.app-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
}

.app-header img {
  height: 36px;
  width: auto;
  border-radius: 8px;
}

.app-header h1 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--river-dark);
}

/* ---------- TOAST NOTIFICATION ---------- */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 200;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ---------- BARRE DE NAVIGATION SUR LA PAGE D'ACCUEIL ---------- */
.home-nav {
  display: flex;
  justify-content: space-around;
  background: white;
  padding: 10px 0;
  margin: 0 16px 8px 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.home-nav a {
  text-decoration: none;
  color: var(--text-light);
  font-weight: 500;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}

.home-nav a i {
  font-size: 1.2rem;
}

.home-nav a.active,
.home-nav a:hover {
  color: var(--orange);
  background: rgba(224,82,6,0.1);
}

/* ---------- BARRE DE RECHERCHE AVEC ICÔNE ---------- */
.search-wrapper {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
  position: relative; /* pour le dropdown des suggestions */
}

.search-wrapper input {
  flex: 1;
  border: none;
  padding: 0.75rem 1rem;
  outline: none;
  background: transparent;
  font-size: 1rem;
}

.search-wrapper input:focus {
  box-shadow: none;
}

.search-wrapper .search-btn {
  background: var(--orange);
  color: white;
  border: none;
  padding: 0.75rem 1.2rem;
  cursor: pointer;
  transition: background var(--ease-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-wrapper .search-btn:hover {
  background: var(--orange-dark);
}

/* ---------- SUGGESTIONS DE RECHERCHE ---------- */
.suggestions-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 10;
}

.suggestion-item {
  padding: 0.5rem 1rem;
  cursor: pointer;
}

.suggestion-item:hover {
  background: var(--bg);
}

/* ---------- CARROUSEL PAR CATÉGORIE ---------- */
.category-section {
  margin-bottom: 1.5rem;
}

.carousel-container {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 0.75rem;
  padding: 0.5rem 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;          /* Firefox */
}

.carousel-container::-webkit-scrollbar {
  display: none;                  /* Chrome, Safari */
}

.carousel-container .product-card {
  flex: 0 0 45%;                  /* largeur d'une carte (ajustez selon vos besoins) */
  scroll-snap-align: start;
}

/* Flèches de navigation */
.carousel-controls {
  display: flex;
  gap: 0.5rem;
}

.carousel-controls .btn-sm {
  padding: 0.3rem 0.8rem;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  background: white;
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
}

.carousel-controls .btn-sm:hover {
  background: var(--orange);
  color: white;
}

/* ---------- PIED DE PAGE PROMOTIONNEL ---------- */
.promo-footer {
  background: linear-gradient(135deg, var(--river-dark) 0%, var(--river) 100%);
  color: white;
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 0.9rem;
  margin-top: 2rem;
}

.promo-footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  max-width: 700px;
  margin: 0 auto 1rem auto;
  gap: 1rem;
}

.promo-left {
  text-align: left;
}

.promo-name {
  font-weight: 700;
  font-size: 1.1rem;
}

.promo-title {
  font-size: 0.85rem;
  opacity: 0.85;
}

.promo-location {
  font-size: 0.8rem;
  opacity: 0.7;
}

.promo-right {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: right;
}

.promo-link {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: color var(--ease-fast);
}

.promo-link:hover {
  color: #FFDDB5;
}

.promo-tagline {
  margin-top: 0.75rem;
  font-style: italic;
  opacity: 0.85;
  border-top: 1px solid rgba(255,255,255,0.2);
  padding-top: 0.75rem;
  font-size: 0.85rem;
}

/* ---------- MODE SOMBRE ---------- */
[data-theme="dark"] {
  --bg: #1a1a2e;
  --surface: #2a2a3a;
  --surface-alt: #333344;
  --text: #e0e0e0;
  --text-light: #b0b0c0;
  --text-muted: #888;
  --border: #444;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);
  --sand: #3a3a4a;
  --sand-light: #2a2a3a;
  --orange: #f06a1f;
  --orange-dark: #e05206;
  --green: #15d44a;
  --river-dark: #1B6B93;
  --river: #4A90E2;
}

/* ---------- MODE CONTRASTE ÉLEVÉ (ACCESSIBILITÉ) ---------- */
.high-contrast {
  --bg: black;
  --surface: #222;
  --text: white;
  --text-light: #ddd;
  --border: #555;
  --orange: #ff6600;
  --orange-dark: #cc5500;
  --green: #33cc33;
  --river-dark: #003366;
  --river: #0055aa;
}

.high-contrast .btn {
  border: 2px solid currentColor;
}

/* ---------- RESPONSIVE FINE-TUNING ---------- */
@media (max-width: 400px) {
  .product-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
}

@media (min-width: 601px) {
  .container {
    padding: 1.5rem 2rem;
  }
}

/* Animation de flottement pour le logo */
.logo-animated {
    animation: floatLogo 3s ease-in-out infinite;
}

@keyframes floatLogo {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
     }
