/* =============================================
   IMKLI — Modern CSS Design
   Design moderne inspiré des standards SaaS
   ============================================= */

/* --- Variables CSS --- */
:root {
  /* Couleurs principales (basées sur le logo) */
  --primary: #2E7D32; /* Vert foncé du logo */
  --primary-dark: #1B5E20;
  --primary-light: #4CAF50;
  
  /* Couleurs or/dorées du logo */
  --gold: #D4AF37;
  --gold-dark: #B8860B;
  --gold-light: #F4C430;
  --gold-pale: #FFF8DC;
  
  /* Couleurs neutres */
  --white: #FFFFFF;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
  
  /* Couleurs d'accent */
  --accent-gold: #D4AF37;
  --accent-red: #EF4444;
  --accent-blue: #3B82F6;
  
  /* Ombres */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Rayon des coins */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition: 200ms ease;
  --transition-slow: 300ms ease;
  
  /* Typography */
  --font-sans: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* --- Reset & Base --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: linear-gradient(135deg, var(--gold-pale) 0%, var(--white) 50%, var(--gray-50) 100%);
  color: var(--gray-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--gray-900);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
  color: var(--gray-600);
  margin-bottom: 1rem;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
}

/* --- Layout --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-fluid {
  width: 100%;
  padding: 0 1.5rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin: -0.75rem;
}

.col {
  flex: 1;
  padding: 0.75rem;
}

.col-auto {
  flex: 0 0 auto;
  padding: 0.75rem;
}

/* --- Navbar --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--white);
  box-shadow: var(--shadow);
  z-index: 1000;
  padding: 1rem 0;
  transition: box-shadow var(--transition);
}

.navbar.scrolled {
  box-shadow: var(--shadow-md);
}

.navbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-logo {
  height: 80px;
  width: auto;
  object-fit: contain;
}

.navbar-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

/* RTL Support */
[dir="rtl"] .navbar-menu {
  flex-direction: row-reverse;
}

[dir="rtl"] .navbar-brand {
  margin-left: 0;
  margin-right: auto;
}

[dir="rtl"] .hero-buttons {
  flex-direction: row-reverse;
}

[dir="rtl"] .cart-item {
  flex-direction: row-reverse;
}

[dir="rtl"] .form-group {
  text-align: right;
}

[dir="rtl"] .card-footer {
  flex-direction: column-reverse;
}

.navbar-link {
  color: var(--gray-600);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.navbar-link:hover,
.navbar-link.active {
  color: var(--primary);
  background: var(--gray-100);
}

.navbar-button {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.navbar-button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.navbar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray-700);
}

/* --- Hero Section --- */
.hero {
  padding: 8rem 0 4rem;
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--white) 100%);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-700) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 0.6s ease;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--gray-600);
  margin-bottom: 2rem;
  animation: fadeInUp 0.6s ease 0.1s backwards;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeInUp 0.6s ease 0.2s backwards;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--white);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

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

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* --- Day Selector --- */
.day-selector {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.day-button {
  flex: 1;
  min-width: 100px;
  padding: 0.875rem 1.5rem;
  background: var(--gray-100);
  border: 2px solid transparent;
  border-radius: var(--radius);
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.day-button:hover {
  background: var(--gray-200);
  transform: translateY(-2px);
}

.day-button.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

/* --- Cards --- */
.card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: all var(--transition);
  border: 1px solid var(--gray-100);
}

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

.card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.card:hover .card-image {
  transform: scale(1.05);
}

.card-image-wrapper {
  overflow: hidden;
  position: relative;
}

.card-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--primary);
  color: var(--white);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.card-badge.new {
  background: var(--accent-gold);
}

.card-badge.badge-closed {
  background: var(--red);
  color: var(--white);
}

.card-disabled {
  opacity: 0.6;
  pointer-events: none;
}

.card-disabled .card-image {
  filter: grayscale(50%);
}

.card-disabled .card-title,
.card-disabled .card-description,
.card-disabled .card-price {
  color: var(--gray-500);
}

.card-body {
  padding: 1.5rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--gray-900);
}

.card-description {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.card-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 1rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-100);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-select {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.card-select input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--primary);
  cursor: pointer;
}

.card-select label {
  font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
}

.card-note {
  margin-top: 1rem;
}

.card-note-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: var(--font-sans);
  transition: border-color var(--transition-fast);
}

.card-note-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.card-note-input::placeholder {
  color: var(--gray-400);
}

/* --- Cart Section --- */
.cart-section {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 2rem;
  position: sticky;
  top: 6rem;
}

.cart-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.cart-header h3 {
  font-size: 1.5rem;
  color: var(--gray-900);
}

.cart-items {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 1.5rem;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--gray-100);
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-name {
  font-weight: 500;
  color: var(--gray-700);
}

.cart-item-price {
  font-weight: 600;
  color: var(--primary);
}

.cart-item-info {
  flex: 1;
}

.cart-item-note {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
  font-style: italic;
}

.cart-empty {
  text-align: center;
  padding: 2rem;
  color: var(--gray-500);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-top: 2px solid var(--gray-200);
  margin-bottom: 1.5rem;
}

.cart-total-label {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-700);
}

.cart-total-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary);
}

.cart-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-weight: 600;
  color: var(--gray-700);
  font-size: 0.875rem;
}

.form-input {
  padding: 0.875rem 1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: all var(--transition-fast);
  font-family: var(--font-sans);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-input::placeholder {
  color: var(--gray-400);
}

/* --- Footer --- */
.footer {
  background: var(--gray-900);
  color: var(--gray-300);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand {
  color: var(--white);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: block;
}

.footer-logo {
  height: 100px;
  width: auto;
  object-fit: contain;
  margin-bottom: 1rem;
}

.footer-section h4 {
  color: var(--white);
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--gray-400);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-bottom {
  border-top: 1px solid var(--gray-800);
  padding-top: 2rem;
  text-align: center;
  color: var(--gray-500);
  font-size: 0.875rem;
}

/* --- Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

.fade-in-up {
  animation: fadeInUp 0.5s ease;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .container {
    max-width: 100%;
    padding: 0 1rem;
  }
  
  .hero-title {
    font-size: 3rem;
  }
}

@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.5rem; }

  /* Navbar plus compacte sur mobile : le logo passe de 80px à 44px,
     et le padding vertical est réduit, pour que la navbar reste basse. */
  .navbar {
    padding: 0.6rem 0;
  }

  .navbar-logo {
    height: 44px;
  }

  /* Le hero doit descendre d'au moins la hauteur réelle de la navbar
     mobile (≈ 44px logo + 19px padding ≈ 63px) + une marge de confort. */
  .hero {
    padding: 6.5rem 0 3rem;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .navbar-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    gap: 0.5rem;
  }
  
  .navbar-menu.active {
    display: flex;
  }
  
  .navbar-toggle {
    display: block;
  }
  
  .day-selector {
    flex-direction: column;
  }
  
  .day-button {
    min-width: auto;
  }
  
  .cart-section {
    position: static;
    margin-top: 2rem;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  /* Adjust main layout for mobile */
  main .col {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
  
  /* Meal cards full width on mobile */
  #meals-container .col {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
}

@media (max-width: 480px) {
  /* Logo encore plus compact sur très petit écran */
  .navbar-logo {
    height: 38px;
  }

  .hero {
    padding: 6rem 0 2.5rem;
  }

  .hero-title {
    font-size: 2rem;
  }
  
  .hero-buttons {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }
  
  .card {
    border-radius: var(--radius-lg);
  }
  
  .day-button {
    padding: 0.75rem 1rem;
  }
}
/* --- Utilities --- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }
.p-5 { padding: 3rem; }

.d-flex { display: flex; }
.d-none { display: none; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
