:root {
  --orange: #FF6B35;
  --orange-light: #FF8F5E;
  --brown: #3D2314;
  --brown-light: #5C3A2A;
  --brown-dark: #2A1508;
  --cream: #FFF4EE;
  --cream-mid: #FFE8D9;
  --beige: #FDFBF8;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

::selection {
  background: var(--orange);
  color: #fff;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Nunito', sans-serif;
  color: var(--brown);
  background: var(--beige);
  overflow-x: hidden;
  padding-bottom: 90px;
  /* Espace pour la sticky bar */
}

img {
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  font-family: 'Fredoka', sans-serif;
}

/* ANIMATIONS PREMIUM */
@keyframes marquee {
  0% {
    transform: translateX(0)
  }

  100% {
    transform: translateX(-50%)
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(40px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

@keyframes wiggle {

  0%,
  100% {
    transform: rotate(0)
  }

  25% {
    transform: rotate(-4deg)
  }

  75% {
    transform: rotate(4deg)
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-12px)
  }
}

@keyframes bounce2 {

  0%,
  100% {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-6px)
  }
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1)
  }

  50% {
    transform: scale(1.05)
  }
}

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.fredoka {
  font-family: 'Fredoka', sans-serif;
}

/* ===== TOP BAR ===== */
.topbar {
  background: var(--orange);
  color: #fff;
  padding: 10px 0;
  overflow: hidden;
}

.topbar-inner {
  display: flex;
  animation: marquee 25s linear infinite;
  white-space: nowrap;
}

.topbar-inner span {
  display: inline-flex;
  gap: 30px;
  padding-right: 30px;
  font-family: 'Fredoka', sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* ===== NAV ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(253, 251, 248, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 232, 217, 0.5);
  padding: 0 40px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.nav.scrolled {
  box-shadow: 0 10px 30px rgba(61, 35, 20, 0.08);
  background: rgba(253, 251, 248, 0.98);
  height: 64px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.3s;
}

.nav-logo img {
  height: 45px;
  width: auto;
  object-fit: contain;
  background: transparent;
  mix-blend-mode: multiply;
}

.nav-logo:hover {
  transform: scale(1.05) rotate(-2deg);
}

.nav-logo span.text {
  font-family: 'Fredoka', sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--brown);
  letter-spacing: -0.5px;
}

.nav-logo .orange {
  color: var(--orange);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  font-family: 'Fredoka', sans-serif;
  font-size: 15px;
  font-weight: 600;
}

.nav-links>a,
.nav-links>div>a {
  color: var(--brown-light);
  transition: all 0.3s;
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
}

.nav-links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--orange);
  transition: width 0.3s ease;
}

.nav-links a:hover {
  color: var(--orange);
}

.nav-links a:hover::after {
  width: 100%;
}

/* ================= NAV DROPDOWN ================= */
.dropdown {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.dropdown-content {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: rgba(253, 251, 248, 0.98);
  min-width: 220px;
  box-shadow: 0px 15px 30px rgba(61, 35, 20, 0.1);
  border: 1px solid rgba(61, 35, 20, 0.05);
  border-radius: 12px;
  padding: 10px 0;
  z-index: 101;
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.dropdown:hover .dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  padding: 12px 24px;
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--brown-light);
  transition: background 0.2s, color 0.2s;
}

.dropdown-item:hover {
  background-color: rgba(255, 107, 53, 0.08);
  /* --orange with low opacity */
  color: var(--orange);
}

.dropdown-item::after {
  display: none;
  /* Pas de soulignement sur les items du sous-menu */
}

.nav-icons {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 22px;
}

.nav-icons span {
  cursor: pointer;
  transition: transform 0.3s;
}

.nav-icons span:hover {
  transform: translateY(-3px) scale(1.1);
}

.nav-icons .cart-badge {
  position: relative;
}

.nav-icons .cart-badge::after {
  content: '0';
  position: absolute;
  top: -6px;
  right: -8px;
  background: var(--orange);
  color: #fff;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--beige);
}

.nav-auth {
  display: flex;
  align-items: center;
  gap: 15px;
  font-family: 'Fredoka', sans-serif;
  font-size: 15px;
  margin-right: 15px;
}

.nav-auth a {
  font-weight: 700;
  color: var(--brown);
  transition: all 0.3s;
}

.nav-auth a:hover {
  color: var(--orange);
}

.nav-btn-orange {
  background: var(--orange) !important;
  color: #fff !important;
  padding: 8px 18px;
  border-radius: 20px;
  box-shadow: 0 4px 10px rgba(255, 107, 53, 0.2);
}

.nav-btn-orange:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(255, 107, 53, 0.3);
}

/* ===== HERO ===== */
.hero {
  position: relative;
  background: radial-gradient(circle at 80% 20%, #FFF8F2 0%, var(--beige) 100%);
  overflow: hidden;
  min-height: 85vh;
  display: flex;
  align-items: center;
}

.hero-shape1 {
  position: absolute;
  top: 10%;
  right: 15%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 107, 53, 0.08) 0%, transparent 70%);
  animation: pulse 8s infinite alternate;
}

.hero-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  gap: 60px;
  position: relative;
  z-index: 2;
  width: 100%;
}

.hero-left {
  flex: 1.1;
  animation: fadeUp 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hero-right {
  flex: 0.9;
  position: relative;
  animation: fadeUp 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s both;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 30px;
  padding: 8px 20px;
  box-shadow: 0 10px 30px rgba(61, 35, 20, 0.06);
  margin-bottom: 30px;
  border: 1px solid rgba(255, 107, 53, 0.1);
}

.hero-badge .sparkle {
  animation: bounce2 2s ease infinite;
  font-size: 16px;
}

.hero h1 {
  font-family: 'Fredoka', sans-serif;
  font-size: 72px;
  font-weight: 800;
  line-height: 1.05;
  margin-bottom: 24px;
  color: var(--brown);
  letter-spacing: -1px;
}

.hero h1 .legendary {
  background: linear-gradient(135deg, var(--orange), #FF512F);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  animation: wiggle 5s ease-in-out infinite;
}

.hero h1 .emoji {
  font-size: 50px;
  display: inline-block;
  margin-left: 12px;
  animation: float 4s ease-in-out infinite;
}

.hero p.desc {
  font-size: 19px;
  line-height: 1.6;
  color: rgba(61, 35, 20, 0.7);
  max-width: 500px;
  margin-bottom: 40px;
  font-weight: 500;
}

.hero-buttons {
  display: flex;
  gap: 20px;
  margin-bottom: 40px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--orange) 0%, #FF512F 100%);
  color: #fff;
  border-radius: 16px;
  padding: 18px 36px;
  font-size: 17px;
  font-weight: 700;
  box-shadow: 0 15px 35px rgba(255, 107, 53, 0.3);
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn-primary:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(255, 107, 53, 0.4);
}

.btn-primary:hover::after {
  left: 100%;
}

.hero-features {
  display: flex;
  gap: 30px;
}

.hero-features span {
  font-size: 14px;
  color: rgba(61, 35, 20, 0.6);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Fredoka', sans-serif;
}

.hero-img-wrap {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  aspect-ratio: 4/5;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 40px 80px rgba(61, 35, 20, 0.15);
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
}

.hero-img-wrap:hover {
  transform: scale(1.02);
}

.hero-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-float-left {
  position: absolute;
  top: 15%;
  left: -40px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 12px 20px;
  box-shadow: 0 15px 35px rgba(61, 35, 20, 0.1);
  animation: float 4.5s ease-in-out infinite;
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-float-right {
  position: absolute;
  bottom: 20%;
  right: -30px;
  background: var(--brown);
  border-radius: 16px;
  padding: 14px 24px;
  box-shadow: 0 15px 35px rgba(61, 35, 20, 0.2);
  animation: float 5s ease-in-out infinite 1s;
  color: #fff;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ===== SECTION HELPERS ===== */
.section {
  padding: 100px 40px;
}

.section-inner {
  max-width: 1400px;
  margin: 0 auto;
}

.section-tag {
  display: inline-block;
  font-family: 'Fredoka', sans-serif;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 20px;
  border-radius: 30px;
  margin-bottom: 16px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.tag-cream {
  background: #fff;
  color: var(--orange);
  box-shadow: 0 5px 15px rgba(255, 107, 53, 0.1);
}

.tag-orange {
  background: var(--orange);
  color: #fff;
}

.section-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 20px;
}

/* ===== PRODUCTS GRID ===== */
.bestsellers {
  background: #fff;
}

.products-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 50px;
}

.products-header h2 {
  font-family: 'Fredoka', sans-serif;
  font-size: 42px;
  font-weight: 800;
  color: var(--brown);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.product-card {
  background: var(--beige);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  cursor: pointer;
  border: 1px solid rgba(61, 35, 20, 0.05);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 25px 50px rgba(61, 35, 20, 0.1);
}

.product-card .img-wrap {
  position: relative;
  overflow: hidden;
  flex: 1;
  aspect-ratio: 4/5;
}

.product-card .img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s;
}

.product-card:hover .img-wrap img {
  transform: scale(1.08);
}

.product-card .badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background: #fff;
  color: var(--orange);
  font-family: 'Fredoka', sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 30px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  z-index: 2;
}

.product-card .info {
  padding: 24px;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.product-card .name {
  font-family: 'Fredoka', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--brown);
  line-height: 1.3;
  margin-bottom: 15px;
}

.product-card .price {
  font-family: 'Fredoka', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--orange);
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.checkout-btn {
  background: var(--brown);
  color: #fff;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  transition: 0.3s;
}

.checkout-btn:hover {
  background: var(--orange);
  transform: scale(1.05);
}

/* ================= SIDECART (TIROIR PANIER) ================= */
.sidecart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(61, 35, 20, 0.5);
  /* var(--brown) semi-transparent */
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sidecart-overlay.active {
  opacity: 1;
  visibility: visible;
}

.sidecart {
  position: fixed;
  top: 0;
  right: -100%;
  /* Caché hors de l'écran par défaut */
  width: 100%;
  max-width: 420px;
  height: 100vh;
  background: #fff;
  z-index: 10000;
  box-shadow: -10px 0 30px rgba(61, 35, 20, 0.1);
  transition: right 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.sidecart.active {
  right: 0;
}

.sidecart-header {
  padding: 20px 25px;
  border-bottom: 1px solid rgba(61, 35, 20, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidecart-header h2 {
  font-family: 'Fredoka', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--brown);
  margin: 0;
}

.sidecart-close {
  background: none;
  border: none;
  font-size: 30px;
  line-height: 1;
  color: var(--brown);
  cursor: pointer;
  transition: transform 0.2s;
}

.sidecart-close:hover {
  transform: scale(1.2) rotate(90deg);
  color: var(--orange);
}

/* Barre de progression livraison gratuite */
.free-shipping-bar-container {
  padding: 15px 25px;
  background: rgba(253, 251, 248, 1);
  /* var(--beige) */
  border-bottom: 1px solid rgba(61, 35, 20, 0.05);
}

.shipping-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--brown-light);
  margin-bottom: 8px;
  text-align: center;
}

.shipping-progress-bg {
  width: 100%;
  height: 8px;
  background: rgba(61, 35, 20, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.shipping-progress-fill {
  height: 100%;
  background: var(--orange);
  width: 0%;
  transition: width 0.5s ease-out;
}

.sidecart-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 25px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidecart-empty {
  text-align: center;
  padding: 40px 20px;
  color: rgba(61, 35, 20, 0.6);
  font-weight: 600;
  display: none;
  /* Affiché via JS si le panier est vide */
}

/* Items du Sidecart (Réutilisation partielle des styles de cart.html si possible, adapté) */
.sc-item {
  display: flex;
  gap: 15px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(61, 35, 20, 0.05);
  position: relative;
}

.sc-item-img {
  width: 80px;
  height: 100px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--beige);
}

.sc-item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sc-item-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--brown);
  padding-right: 20px;
  line-height: 1.2;
}

.sc-item-meta {
  font-size: 12px;
  color: rgba(61, 35, 20, 0.6);
  margin-top: 4px;
}

.sc-item-price-qty {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.sc-price {
  font-weight: 700;
  color: var(--orange);
  font-size: 15px;
}

.sc-remove {
  position: absolute;
  top: 0;
  right: 0;
  background: none;
  border: none;
  font-size: 18px;
  color: rgba(61, 35, 20, 0.4);
  cursor: pointer;
  transition: color 0.2s;
}

.sc-remove:hover {
  color: #ff3333;
}

.qty-controls.small {
  padding: 4px;
}

.qty-controls.small .qty-btn {
  width: 24px;
  height: 24px;
}

.sidecart-footer {
  padding: 20px 25px 30px;
  background: #fff;
  border-top: 1px solid rgba(61, 35, 20, 0.1);
  box-shadow: 0 -10px 20px rgba(61, 35, 20, 0.03);
}

.sc-summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  font-size: 15px;
  font-weight: 600;
  color: var(--brown-light);
}

.sc-summary-row.total {
  font-family: 'Fredoka', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--brown);
  border-top: 2px dashed rgba(61, 35, 20, 0.1);
  padding-top: 15px;
  margin-bottom: 20px;
}

.btn-checkout-sidecart {
  width: 100%;
  padding: 16px;
  background: var(--brown);
  color: #fff;
  font-family: 'Fredoka', sans-serif;
  font-size: 16px;
  font-weight: 700;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  transition: all 0.3s;
}

.btn-checkout-sidecart:hover {
  background: var(--brown-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(61, 35, 20, 0.15);
}

.btn-view-cart {
  width: 100%;
  padding: 12px;
  background: transparent;
  color: var(--brown);
  font-family: 'Fredoka', sans-serif;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid rgba(61, 35, 20, 0.1);
  border-radius: 12px;
  margin-top: 10px;
  transition: all 0.3s;
}

.btn-view-cart:hover {
  background: rgba(61, 35, 20, 0.05);
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .hero-inner {
    flex-direction: column;
    padding: 60px 30px;
    text-align: center;
  }

  .hero-left,
  .hero-right {
    flex: 1;
  }

  .hero-features {
    justify-content: center;
    flex-wrap: wrap;
  }

  .hero-buttons {
    justify-content: center;
  }

  .hero-float-left,
  .hero-float-right {
    display: none;
  }

  .hero h1 {
    font-size: 60px;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-links {
    display: none;
  }
}

@media (max-width: 600px) {
  .hero h1 {
    font-size: 42px;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: 36px;
  }
}