:root {
  --primary: #FF4757;
  /* Un rouge/rose vibrant, très appétissant et dynamique */
  --primary-hover: #FF6B81;
  --bg-color: #F8F9FA;
  --text-dark: #1e293b;
  --text-light: #64748b;
  --card-bg: #FFFFFF;
  --border-radius: 20px;
  /* V2 Premium: Bords plus arrondis */
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
  /* V2 Premium Apple-like shadow */
  --shadow-lg: 0 20px 50px -12px rgba(0, 0, 0, 0.12);
  /* V2 Premium */
  --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* === SEASONAL THEMES === */
body.theme-valentine {
  --primary: #e11d48;
  /* Rose Crimson profond */
  --primary-hover: #f43f5e;
  --bg-color: #fff1f2;
  /* Rose très pâle */
}

body.theme-christmas {
  --primary: #16a34a;
  /* Vert sapin */
  --primary-hover: #15803d;
  --bg-color: #f0fdf4;
  /* Vert très pâle */
}

body.theme-christmas .btn-primary {
  box-shadow: 0 4px 15px rgba(22, 163, 74, 0.3);
}

body.theme-newyear {
  --primary: #fbbf24;
  --primary-hover: #fcd34d;
  --bg-color: #0f172a;
  --card-bg: #1e293b;
  --text-dark: #ffffff;
  --text-light: #94a3b8;
}

body.theme-newyear .btn-primary {
  box-shadow: 0 4px 15px rgba(202, 138, 4, 0.3);
}

body.theme-ramadan {
  --primary: #059669;
  /* Vert émeraude oriental */
  --primary-hover: #047857;
  --bg-color: #f8fafc;
  /* Reste neutre mais on peut ajouter des motifs via js/css plus tard */
}

body.theme-ramadan .btn-primary {
  box-shadow: 0 4px 15px rgba(5, 150, 105, 0.3);
}


/* === MODERN SCROLLBARS === */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* === B2B APP COMPONENTS === */
.admin-card {
  background: #ffffff;
  border-radius: var(--border-radius);
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
  /* Lighter default shadow */
  padding: 2.5rem;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.admin-card:hover {
  box-shadow: var(--shadow-md);
  /* Use new soft floaty shadow */
  transform: translateY(-4px);
}

.stat-card {
  background: #ffffff;
  border-radius: var(--border-radius);
  padding: 1.8rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(226, 232, 240, 0.6);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  /* Slightly thicker */
  background: var(--primary);
  opacity: 0.9;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body,
input,
select,
textarea,
button {
  font-family: 'Outfit', sans-serif;
  color: var(--text-dark);
}

body {
  background-color: var(--bg-color);
  line-height: 1.6;

  /* Validation Apple App Store: Support du Notch / Dynamic Island */
  padding-top: env(safe-area-inset-top, 0);
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}

/* === NAVIGATION === */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 5%;
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -1px;
}

.logo-i {
  color: var(--text-dark);
}

.logo-promo {
  color: var(--primary);
}

nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
}

nav a {
  text-decoration: none;
  color: var(--text-light);
  font-weight: 600;
  transition: var(--transition);
}

nav a:hover,
nav a.active {
  color: var(--primary);
}

.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.8rem 1.8rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(255, 71, 87, 0.3);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 71, 87, 0.4);
}

/* === HERO SECTION === */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5rem 5%;
  min-height: calc(100vh - 80px);
  /* 80px est environ la hauteur de la navbar */
}

.hero-content {
  flex: 1;
  max-width: 600px;
}

.hero h1 {
  font-size: 4rem;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: var(--text-dark);
}

.highlight {
  color: var(--primary);
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-light);
  margin-bottom: 2.5rem;
}

.search-bar {
  display: flex;
  background: white;
  padding: 0.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  max-width: 500px;
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  background: transparent;
}

.btn-search {
  background: var(--text-dark);
  color: white;
  border: none;
  padding: 0 2rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-search:hover {
  background: #000;
}

.hero-image {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.mock-image {
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, #FFEAA7, #FF7675);
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  box-shadow: var(--shadow-md);
  animation: morph 8s ease-in-out infinite;
}

@keyframes morph {
  0% {
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  }

  50% {
    border-radius: 50% 50% 30% 70% / 70% 30% 70% 30%;
  }

  100% {
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  }
}

/* === SECTION PROMOTIONS === */
.featured-promos {
  padding: 5rem 5%;
}

.featured-promos h2 {
  font-size: 2.5rem;
  margin-bottom: 2.5rem;
  text-align: center;
  color: var(--text-dark);
}

.promo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

/* Style des cartes de restaurant */
.promo-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  cursor: pointer;
}

.promo-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-md);
}

.promo-image {
  height: 200px;
  background-color: #ddd;
  /* Remplaçant si pas d'image */
  background-size: cover;
  background-position: center;
  position: relative;
}

/* Le petit badge rond pour la promo (-50%, Cadeau, etc.) */
.promo-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: var(--primary);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* === LIVE STOCK BADGE === */
.live-stock-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 10;
  transition: transform 0.3s ease, background 0.3s ease;
}

.live-stock-badge .fire-icon {
  font-size: 1rem;
  animation: flicker 2s infinite alternate;
}

@keyframes flicker {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }

  100% {
    transform: scale(0.95);
    opacity: 1;
  }
}

.live-stock-badge.stock-pulse,
.live-stock-badge-dash.stock-pulse {
  animation: stockPulse 1s cubic-bezier(0.25, 1, 0.5, 1);
  background: rgba(239, 68, 68, 0.95) !important;
}

@keyframes stockPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }

  50% {
    transform: scale(1.1);
    box-shadow: 0 0 20px 10px rgba(239, 68, 68, 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.stock-heartbeat {
  animation: stockHeartbeat 1.5s infinite;
}

@keyframes stockHeartbeat {
  0% {
    transform: scale(1);
  }

  14% {
    transform: scale(1.1);
  }

  28% {
    transform: scale(1);
  }

  42% {
    transform: scale(1.1);
  }

  70% {
    transform: scale(1);
  }
}

.promo-content {
  padding: 1.5rem;
}

.restaurant-name {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.restaurant-category {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.promo-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

.btn-get-promo {
  width: 100%;
  padding: 0.8rem;
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: var(--border-radius);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
}

.promo-card:hover .btn-get-promo {
  background: var(--primary);
  color: white;
}

/* === MODAL COUPON (Cachée par défaut) === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: #ffffff;
  padding: 2.5rem;
  border-radius: 24px;
  max-width: 450px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  text-align: center;
  position: relative;
  transform: translateY(30px) scale(0.95);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-overlay.active .modal-content {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
}

.coupon-code-box {
  background: #f1f2f6;
  border: 2px dashed var(--text-light);
  padding: 1rem;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 5px;
  color: var(--text-dark);
  margin: 1.5rem 0;
  border-radius: 10px;
  user-select: all;
  /* Permet de sélectionner facilement le texte */
}

/* === SECTIONS INFORMATIVES (Comment ça marche, FAQ, Contact) === */
.info-section {
  padding: 5rem 5%;
}

.faq-item h3:hover {
  color: var(--primary);
}

.faq-answer {
  max-height: 500px;
  overflow: hidden;
  transition: var(--transition);
}

.faq-answer.hidden {
  max-height: 0;
  margin-top: 0 !important;
  opacity: 0;
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .hero {
    flex-direction: column;
    text-align: center;
    padding-top: 3rem;
  }

  .hero h1 {
    font-size: 2.8rem;
  }

  .search-bar {
    margin: 0 auto;
    flex-wrap: wrap;
    border-radius: 20px;
  }

  .search-bar input {
    border-radius: 20px;
    text-align: center;
  }

  .search-bar .btn-primary {
    border-radius: 20px;
    width: 100%;
  }

  .mock-image {
    width: 250px;
    height: 250px;
    margin-top: 2rem;
  }

  .mobile-menu-btn {
    display: block !important;
  }

  #main-nav {
    display: none;
    width: 100%;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    padding: 1rem;
    box-shadow: var(--shadow-md);
    z-index: 99;
  }

  #main-nav.active {
    display: block;
  }

  #main-nav ul {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .navbar {
    flex-wrap: wrap;
  }
}

@media (max-width: 600px) {
  .navbar {
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
  }

  .header-actions {
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
  }

  .country-selector-container {
    flex: 1;
    min-width: 200px;
    justify-content: center;
  }

  .btn-primary {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }
}

/* === UI PARTENAIRE "NATIVE APP" === */
/* Desktop Layout */
@media (min-width: 1025px) {
  .partner-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
  }

  .partner-sidebar {
    width: 280px;
    background: #0f172a;
    color: white;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }

  .partner-content {
    flex: 1;
    background: #f8fafc;
    overflow-y: auto;
    padding: 2rem;
  }

  .bottom-nav {
    display: none;
  }
}

/* Mobile Layout */
@media (max-width: 1024px) {
  .partner-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #f8fafc;
  }

  .partner-sidebar {
    display: none;
  }

  /* Hidden on mobile, replaced by bottom nav */
  .partner-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    padding-bottom: 80px;
    /* Espace pour la bottom nav */
  }

  /* Bottom Navigation Bar (Glassmorphism Native App) */
  .bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 75px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    z-index: 1000;
    padding: 0 1rem;
    padding-bottom: env(safe-area-inset-bottom, 0);
    /* Pour les iPhones récents */
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    gap: 6px;
    flex: 1;
    transition: all 0.2s ease;
  }

  .bottom-nav-item.active {
    color: #2563eb;
    transform: scale(1.05);
  }

  .bottom-nav-item.active .bottom-nav-icon {
    transform: translateY(-2px);
  }

  .bottom-nav-icon {
    font-size: 1.6rem;
    transition: transform 0.2s ease;
  }

  /* Floating Action Button pour valider */
  .scan-fab {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 68px;
    height: 68px;
    background: linear-gradient(135deg, #f43f5e, #be123c, #9f1239);
    /* Richer gradient */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 2rem;
    box-shadow: 0 10px 30px rgba(244, 63, 94, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.3);
    /* Multi-layered glow/bevel */
    border: 4px solid #ffffff;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1001;
  }

  .scan-fab:active {
    transform: translateX(-50%) scale(0.92);
    box-shadow: 0 4px 10px rgba(244, 63, 94, 0.3), inset 0 3px 6px rgba(0, 0, 0, 0.2);
  }

  /* Transformer les tables en listes de cartes sur mobile */
  .partner-table-res table,
  .partner-table-res thead,
  .partner-table-res tbody,
  .partner-table-res th,
  .partner-table-res td,
  .partner-table-res tr {
    display: block;
  }

  .partner-table-res thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  .partner-table-res tr {
    background: white;
    border: 1px solid #e2e8f0;
    margin-bottom: 1.25rem;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    padding: 0.8rem;
    position: relative;
    overflow: hidden;
  }

  .partner-table-res td {
    border: none;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
    padding: 0.8rem 1rem 0.8rem 45%;
    text-align: right;
    min-height: 40px;
  }

  .partner-table-res td:last-child {
    border-bottom: none;
  }

  .partner-table-res td:before {
    position: absolute;
    top: 0.8rem;
    left: 1rem;
    width: 40%;
    padding-right: 10px;
    white-space: nowrap;
    text-align: left;
    font-weight: 700;
    color: #94a3b8;
    font-size: 0.8rem;
    text-transform: uppercase;
    content: attr(data-label);
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* === UTILITIES & RESPONSIVE === */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
}