/* =============================================
   SOS Étudiant — Styles principaux
   Palette : Rouge #DC2626 / Noir #111827 / Blanc
   Typo : Space Grotesk (titres) + Inter (corps)
   ============================================= */

/* ---- Variables ---- */
:root {
  --red: #DC2626;
  --red-dark: #991B1B;
  --red-light: #FEE2E2;
  --black: #111827;
  --white: #FFFFFF;
  --gray-bg: #F9FAFB;
  --gray-border: #E5E7EB;
  --gray-text: #4B5563;
}

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

body {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  color: var(--black);
  background:
    radial-gradient(ellipse at top right, rgba(254, 226, 226, 0.6) 0%, transparent 50%),
    radial-gradient(ellipse at bottom left, rgba(254, 226, 226, 0.4) 0%, transparent 50%),
    linear-gradient(180deg, #FFFFFF 0%, #FFF5F5 50%, #FFFFFF 100%);
  background-attachment: fixed;
  line-height: 1.6;
}

/* Image produit avec fallback automatique */
.product-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
  display: block;
}
.product-img-fallback {
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #DC2626;
  font-size: 4rem;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  line-height: 1.2;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s;
}

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

/* ---- Bouton primaire override Bootstrap ---- */
.btn-primary {
  background-color: var(--red);
  border-color: var(--red);
  border-radius: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--red-dark);
  border-color: var(--red-dark);
}

.btn-outline-dark {
  border-width: 2px;
  border-radius: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
}

.btn-outline-dark:hover {
  background-color: var(--black);
  color: var(--white);
}

.btn-light {
  border-radius: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  color: var(--red);
}

.btn-light:hover {
  color: var(--red-dark);
}

/* =============================================
   NAVBAR
   ============================================= */
.navbar {
  padding: 0.8rem 0;
  font-family: 'Inter', sans-serif;
  min-height: 75px;
}

/* ===== Logo navbar (icône + texte) ===== */
.navbar-brand {
  text-decoration: none !important;
}
.navbar-brand .brand-icon {
  height: 50px !important;
  width: auto !important;
  max-width: none !important;
  flex-shrink: 0;
}
.navbar-brand .brand-text {
  font-family: 'Space Grotesk', Arial, sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
}
.navbar-brand .brand-sos {
  color: #DC2626;
  margin-right: 0.3rem;
}
.navbar-brand .brand-etu {
  color: #111827;
}
@media (max-width: 575px) {
  .navbar-brand .brand-text { font-size: 1.1rem; }
  .navbar-brand .brand-icon { height: 36px !important; width: 36px !important; }
}

/* Espacement automatique sous la navbar fixée */
main {
  padding-top: 90px;
}

/* Hero section gère son propre padding-top */
main .hero-section {
  padding-top: 0;
  margin-top: -90px;
  padding: 100px 0 60px;
}

/* Pour toutes les pages secondaires : assure que le contenu démarre bien sous la navbar */
main > section:first-child:not(.hero-section) {
  padding-top: 40px !important;
}

.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: var(--red);
  color: var(--white);
  border-radius: 10px;
  font-size: 1.1rem;
}

.logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--black);
}

.logo-light {
  font-weight: 300;
}

.nav-link {
  font-weight: 500;
  color: var(--gray-text);
  padding: 0.5rem 1rem !important;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--black);
}

.nav-icon {
  color: var(--gray-text);
  font-size: 1.15rem;
  transition: color 0.2s;
}

.nav-icon:hover {
  color: var(--red);
}

.badge-cart {
  position: absolute;
  top: -6px;
  right: -8px;
  background-color: var(--red);
  color: var(--white);
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =============================================
   HERO — design boosté
   ============================================= */
.hero-section {
  min-height: 100vh;
  padding-top: 100px;
  background:
    radial-gradient(circle at 20% 20%, rgba(220, 38, 38, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(220, 38, 38, 0.05) 0%, transparent 50%),
    linear-gradient(180deg, #FFFFFF 0%, #FEE2E2 100%);
  overflow: hidden;
  position: relative;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(220, 38, 38, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-title {
  font-size: clamp(2.2rem, 5.5vw, 4rem);
  color: var(--black);
  margin-bottom: 1.2rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.text-accent {
  background: linear-gradient(135deg, #DC2626 0%, #991B1B 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--gray-text);
  max-width: 500px;
  line-height: 1.7;
}

.hero-image-wrapper {
  position: relative;
}

.hero-image-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(220, 38, 38, 0.2) 0%, transparent 60%);
  filter: blur(40px);
  z-index: -1;
}

.hero-image {
  filter: drop-shadow(0 30px 60px rgba(220, 38, 38, 0.25));
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-20px) rotate(2deg); }
}

/* Boutons hero plus stylés */
.hero-section .btn-primary {
  background: linear-gradient(135deg, #DC2626 0%, #991B1B 100%);
  border: none;
  box-shadow: 0 8px 24px rgba(220, 38, 38, 0.3);
  transition: all 0.3s ease;
}

.hero-section .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(220, 38, 38, 0.4);
}

.stat-number {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--black);
  margin-bottom: 0;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--gray-text);
  margin-bottom: 0;
}

/* =============================================
   SECTIONS COMMUNES
   ============================================= */
.section-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  color: var(--black);
}

.section-subtitle {
  color: var(--gray-text);
  font-size: 1.05rem;
}

/* =============================================
   CATEGORIES
   ============================================= */
.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
  background: var(--white);
  border: 2px solid transparent;
  border-radius: 20px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.category-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.05) 0%, rgba(220, 38, 38, 0) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.category-card:hover {
  border-color: var(--red);
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(220, 38, 38, 0.15);
}

.category-card:hover::before {
  opacity: 1;
}

.category-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
  color: var(--red);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 1rem;
  transition: all 0.4s;
  position: relative;
  z-index: 1;
}

.category-card:hover .category-icon {
  background: linear-gradient(135deg, #DC2626 0%, #991B1B 100%);
  color: var(--white);
  transform: rotate(-5deg) scale(1.1);
  box-shadow: 0 8px 16px rgba(220, 38, 38, 0.3);
}

.category-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--black);
  margin: 0;
}

/* =============================================
   PRODUITS
   ============================================= */
.product-card {
  background: var(--white);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--gray-border);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
  border-color: var(--red-light);
}

.product-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, #DC2626 0%, #991B1B 100%);
  transition: width 0.4s ease;
}

.product-card:hover::after {
  width: 100%;
}

.product-image-wrapper {
  position: relative;
  overflow: hidden;
  background: var(--gray-bg);
  aspect-ratio: 1;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

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

.product-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.3));
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.product-card:hover .product-overlay {
  transform: translateY(0);
}

.badge-gamme {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.02em;
}

.badge-mini {
  background-color: var(--gray-bg);
  color: var(--gray-text);
  border: 1px solid var(--gray-border);
}

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

.product-info {
  padding: 1.2rem;
}

.product-category {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-text);
  font-weight: 500;
}

.product-name {
  font-size: 1rem;
  font-weight: 600;
  margin: 0.3rem 0;
  color: var(--black);
}

.product-price {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--red);
  margin: 0;
}

/* =============================================
   BANNIERE PROMO
   ============================================= */
.promo-banner {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
}

/* =============================================
   COMMENT CA MARCHE
   ============================================= */
.step-card {
  padding: 2rem;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background-color: var(--red-light);
  color: var(--red);
  border-radius: 50%;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
}

/* =============================================
   TEMOIGNAGES
   ============================================= */
.testimonial-card {
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: 16px;
  padding: 1.5rem;
  height: 100%;
  transition: all 0.3s;
}

.testimonial-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.testimonial-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--red-light);
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
}

.stars {
  color: #FBBF24;
  font-size: 0.85rem;
}

/* =============================================
   NEWSLETTER
   ============================================= */
.newsletter-input {
  max-width: 320px;
  border-radius: 10px;
  border: 2px solid var(--gray-border);
}

.newsletter-input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
  background-color: var(--black);
}

.logo-icon-footer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: var(--red);
  color: var(--white);
  border-radius: 8px;
  font-size: 1rem;
}

.logo-text-footer {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
}

.footer-heading {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  color: var(--white);
}

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

.footer-links a {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
  transition: color 0.2s;
}

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

.footer-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1rem;
  transition: all 0.2s;
}

.footer-social:hover {
  background-color: var(--red);
  border-color: var(--red);
  color: var(--white);
}

/* =============================================
   ANIMATIONS
   ============================================= */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 991.98px) {
  .hero-section {
    padding-top: 80px;
    min-height: auto;
    padding-bottom: 3rem;
  }

  .navbar-collapse {
    padding: 1rem 0;
  }

  .d-flex.align-items-center.gap-3 {
    justify-content: center;
    padding: 1rem 0;
  }
}

@media (max-width: 575.98px) {
  .hero-title {
    font-size: 1.8rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .promo-banner {
    padding: 2rem 1.5rem !important;
  }

  .promo-banner .display-5 {
    font-size: 1.5rem;
  }

  .newsletter-input {
    max-width: 100%;
  }
}

/* =============================================
   DARK MODE
   ============================================= */
body.dark-mode {
  background: #111827 !important;
  color: #E5E7EB !important;
}
body.dark-mode .bg-light { background-color: #1F2937 !important; }
body.dark-mode .bg-white, body.dark-mode .navbar { background-color: #1F2937 !important; }
body.dark-mode .card, body.dark-mode .product-card { background-color: #1F2937 !important; border-color: #374151 !important; }
body.dark-mode .text-dark { color: #E5E7EB !important; }
body.dark-mode .text-muted { color: #9CA3AF !important; }
body.dark-mode .nav-link { color: #D1D5DB !important; }
body.dark-mode .nav-link.active, body.dark-mode .nav-link:hover { color: #DC2626 !important; }
body.dark-mode .nav-icon { color: #D1D5DB !important; }
body.dark-mode .dropdown-menu { background-color: #1F2937 !important; border-color: #374151 !important; }
body.dark-mode .dropdown-item { color: #D1D5DB !important; }
body.dark-mode .dropdown-item:hover { background-color: #374151 !important; }
body.dark-mode .form-control { background-color: #374151 !important; border-color: #4B5563 !important; color: #E5E7EB !important; }
body.dark-mode .form-control::placeholder { color: #6B7280 !important; }
body.dark-mode .hero-section { background: linear-gradient(135deg, #1F2937, #111827) !important; }
body.dark-mode .category-card { background-color: #1F2937 !important; }
body.dark-mode .category-name { color: #E5E7EB !important; }
body.dark-mode .step-card { background-color: #1F2937 !important; }
body.dark-mode .testimonial-card { background-color: #1F2937 !important; }
body.dark-mode .section-title { color: #F9FAFB !important; }
body.dark-mode .product-info { background-color: #1F2937 !important; }
body.dark-mode .product-name { color: #E5E7EB !important; }
body.dark-mode .product-category { color: #9CA3AF !important; }
body.dark-mode .table { color: #E5E7EB !important; }
body.dark-mode .table-light { background-color: #374151 !important; color: #E5E7EB !important; }
body.dark-mode .accordion-button { background-color: #1F2937 !important; color: #E5E7EB !important; }
body.dark-mode .accordion-body { background-color: #1F2937 !important; }
body.dark-mode .alert { background-color: #374151 !important; border-color: #4B5563 !important; }
body.dark-mode .list-group-item { background-color: #1F2937 !important; border-color: #374151 !important; color: #E5E7EB !important; }
body.dark-mode .shadow-sm { box-shadow: 0 1px 3px rgba(0,0,0,0.4) !important; }
body.dark-mode .border-bottom { border-color: #374151 !important; }
body.dark-mode h1, body.dark-mode h2, body.dark-mode h3, body.dark-mode h4, body.dark-mode h5, body.dark-mode h6 { color: #F9FAFB !important; }
body.dark-mode a.text-dark { color: #E5E7EB !important; }
body.dark-mode a.text-decoration-none { color: #D1D5DB !important; }
