/* ===================================================================
   FEUILLE DE STYLE - LISTE DE NOËL FÉERIQUE & FORÊT ENNEIGÉE
   =================================================================== */

:root {
  --sky-top: #060913;
  --sky-mid: #0b1528;
  --sky-bottom: #162a3f;
  
  --pine-deep: #0a1813;
  --pine-mid: #132e24;
  --pine-light: #1b4332;
  
  --snow-white: #f8fafc;
  --snow-shadow: #cbd5e1;
  --snow-ice: #e0f2fe;
  
  --card-cover-bg: #4a121a; /* Rouge rubis festif et chaleureux */
  --card-cover-gradient: linear-gradient(135deg, #5c1822 0%, #3e0d14 50%, #2a080c 100%);
  --card-gold: #e5b858;
  --card-gold-light: #fef0c7;
  --card-gold-dark: #b5892b;
  --card-inside-bg: #fffbf5; /* Ivoire / parchemin chaleureux */
  --card-inside-panel: #ffffff;
  
  --text-dark: #2d1810;
  --text-muted: #64748b;
  --text-light: #f8fafc;
  
  --crimson-accent: #b91c1c;
  --green-accent: #15803d;
  
  --shadow-lux: 0 25px 60px -15px rgba(0, 0, 0, 0.6), 0 0 40px rgba(229, 184, 88, 0.15);
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.3);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  
  --font-festive: 'Mountains of Christmas', cursive;
  --font-serif: 'Playfair Display', serif;
  --font-royal: 'Cinzel', serif;
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ===================================================================
   RESET & BASE
   =================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  width: 100%;
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  position: relative;
  width: 100%;
  min-height: 100vh;
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  background-color: var(--sky-top);
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
}
}

/* ===================================================================
   DÉCOR SCÉNIQUE : CIEL, MONTAGNES, FORÊT & AURORE
   =================================================================== */
.winter-scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

/* Ciel dégradé avec aurore boréale */
.sky-background {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 45%, var(--sky-bottom) 85%);
  z-index: 1;
}

/* Aurore boréale mouvante */
.aurora {
  position: absolute;
  top: 0;
  left: -20%;
  width: 140%;
  height: 55%;
  background: radial-gradient(ellipse at 40% 0%, rgba(34, 197, 94, 0.18) 0%, rgba(56, 189, 248, 0.12) 35%, rgba(168, 85, 247, 0.08) 60%, transparent 80%);
  filter: blur(40px);
  animation: auroraFlow 16s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes auroraFlow {
  0% { transform: translateY(0) scaleX(1) rotate(-1deg); opacity: 0.6; }
  50% { transform: translateY(15px) scaleX(1.08) rotate(1deg); opacity: 0.85; }
  100% { transform: translateY(-10px) scaleX(0.95) rotate(-2deg); opacity: 0.55; }
}

/* Étoiles générées dynamiquement */
.stars-layer {
  position: absolute;
  inset: 0;
  height: 70%;
  z-index: 2;
}

.star {
  position: absolute;
  border-radius: 50%;
  background-color: #ffffff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
  animation: starTwinkle var(--duration, 3s) ease-in-out infinite alternate;
}

@keyframes starTwinkle {
  0% { opacity: var(--min-opacity, 0.2); transform: scale(0.8); }
  100% { opacity: var(--max-opacity, 1); transform: scale(1.3); }
}

/* Lune éclatante */
.moon {
  position: absolute;
  top: 6%;
  right: 12%;
  width: 86px;
  height: 86px;
  background: radial-gradient(circle at 35% 35%, #fffef0 0%, #fef3c7 65%, #fde68a 100%);
  border-radius: 50%;
  box-shadow: 0 0 45px rgba(254, 243, 199, 0.65), 0 0 90px rgba(254, 243, 199, 0.3);
  z-index: 3;
}

.moon-crater {
  position: absolute;
  background: rgba(217, 119, 6, 0.07);
  border-radius: 50%;
}
.moon-crater.c1 { width: 18px; height: 18px; top: 22px; left: 30px; }
.moon-crater.c2 { width: 12px; height: 12px; top: 48px; left: 24px; }
.moon-crater.c3 { width: 14px; height: 14px; top: 36px; left: 54px; }

/* Traîneau du Père Noël dans le ciel */
.santa-sleigh {
  position: absolute;
  top: 15%;
  left: -250px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 26px;
  filter: drop-shadow(0 0 10px rgba(254, 240, 138, 0.8));
  z-index: 4;
  opacity: 0;
  transition: opacity 1s;
}

.santa-sleigh.flying {
  opacity: 0.95;
  animation: santaFly 18s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes santaFly {
  0% {
    transform: translate(0, 0) scale(0.65) rotate(4deg);
    opacity: 0;
  }
  5% {
    opacity: 0.95;
  }
  85% {
    opacity: 0.95;
  }
  100% {
    transform: translate(calc(100vw + 400px), -60px) scale(0.9) rotate(-3deg);
    opacity: 0;
  }
}

/* Montagnes lointaines */
.mountains-layer {
  position: absolute;
  bottom: 120px;
  left: 0;
  width: 100%;
  height: 250px;
  z-index: 5;
  opacity: 0.8;
}

.mountains-svg {
  width: 100%;
  height: 100%;
}

/* Couches de sapins (Générés en SVG/CSS) */
.forest-layer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
}

.forest-back {
  height: 380px;
  z-index: 6;
  opacity: 0.85;
}

.forest-front {
  height: 280px;
  z-index: 8;
}

/* Guirlandes lumineuses festives */
.fairy-lights-container {
  position: absolute;
  top: 38%;
  left: 0;
  width: 100%;
  height: 140px;
  z-index: 7;
  pointer-events: none;
}

.lights-wire {
  width: 100%;
  height: 100%;
}

.light-bulb {
  position: absolute;
  width: 11px;
  height: 16px;
  border-radius: 50% 50% 40% 40%;
  transform-origin: top center;
  animation: bulbSway 4s ease-in-out infinite alternate;
}

.bulb-gold {
  background: #fef08a;
  box-shadow: 0 0 12px #fef08a, 0 0 24px rgba(254, 240, 138, 0.7);
}

.bulb-red {
  background: #f87171;
  box-shadow: 0 0 12px #f87171, 0 0 24px rgba(248, 113, 113, 0.7);
}

.bulb-green {
  background: #4ade80;
  box-shadow: 0 0 12px #4ade80, 0 0 24px rgba(74, 222, 128, 0.7);
}

.bulb-blue {
  background: #38bdf8;
  box-shadow: 0 0 12px #38bdf8, 0 0 24px rgba(56, 189, 248, 0.7);
}

@keyframes bulbSway {
  0% { transform: rotate(-5deg); filter: brightness(1); }
  50% { filter: brightness(1.3); }
  100% { transform: rotate(5deg); filter: brightness(0.85); }
}

/* Collines de neige au sol */
.ground-snow {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 160px;
  z-index: 9;
}

.snow-hill {
  position: absolute;
  bottom: -40px;
  border-radius: 50%;
  background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 70%, #94a3b8 100%);
}

.hill-1 {
  left: -15%;
  width: 65%;
  height: 200px;
  transform: rotate(3deg);
  box-shadow: inset 0 8px 15px rgba(255, 255, 255, 0.9), 0 -5px 25px rgba(15, 23, 42, 0.3);
}

.hill-2 {
  right: -10%;
  width: 65%;
  height: 220px;
  transform: rotate(-3deg);
  box-shadow: inset 0 8px 15px rgba(255, 255, 255, 0.9), 0 -5px 25px rgba(15, 23, 42, 0.3);
}

.hill-3 {
  left: 25%;
  width: 55%;
  height: 180px;
  background: linear-gradient(180deg, #ffffff 0%, #e8edf3 80%, #cbd5e1 100%);
  box-shadow: inset 0 10px 20px rgba(255, 255, 255, 1), 0 -5px 25px rgba(15, 23, 42, 0.2);
}

.snow-drift-glow {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 90px;
  background: linear-gradient(to top, rgba(248, 250, 252, 0.4), transparent);
}

/* Toiles de neige Canvas */
.snow-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.snow-back { z-index: 4; }
.snow-front { z-index: 10; }

/* ===================================================================
   BARRE DE CONTRÔLES SUPÉRIEURE
   =================================================================== */
.top-bar {
  position: relative;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 30px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.badge-holiday {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f8fafc;
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.top-bar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f8fafc;
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-control:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--card-gold);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(229, 184, 88, 0.3);
}

.btn-control:active {
  transform: translateY(0);
}

.btn-control.active {
  background: rgba(229, 184, 88, 0.25);
  border-color: var(--card-gold);
  color: var(--card-gold-light);
}

/* ===================================================================
   ZONE PRINCIPALE & CARTE 3D
   =================================================================== */
.card-stage {
  position: relative;
  z-index: 20;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 20px 60px 20px;
  perspective: 2000px;
}

.card-3d-wrapper {
  position: relative;
  width: 100%;
  max-width: 500px;
  transition: max-width 0.8s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.card-3d-wrapper.opened {
  max-width: 1140px;
}

.christmas-card {
  position: relative;
  width: 100%;
  background: transparent;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ===================================================================
   1. COUVERTURE DE LA CARTE (VOLET FERMÉ - DESIGN ÉPURÉ & MODERNE)
   =================================================================== */
.card-cover {
  position: relative;
  width: 100%;
  min-height: 520px;
  background: linear-gradient(150deg, rgba(16, 32, 25, 0.92) 0%, rgba(9, 18, 14, 0.96) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(229, 184, 88, 0.35);
  box-shadow: 0 30px 80px -15px rgba(0, 0, 0, 0.7), 0 0 45px rgba(229, 184, 88, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 36px;
  text-align: center;
  color: #fff;
  transition: opacity 0.5s ease, transform 0.8s cubic-bezier(0.34, 1.3, 0.64, 1);
  animation: cardFloating 6s ease-in-out infinite;
}

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

.card-3d-wrapper.opened .card-cover {
  display: none;
  opacity: 0;
  pointer-events: none;
}

/* Lueur d'ambiance et cadre minimaliste */
.cover-ambient-glow {
  position: absolute;
  top: -15%;
  left: 15%;
  width: 70%;
  height: 60%;
  background: radial-gradient(circle at 50% 30%, rgba(229, 184, 88, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.cover-minimal-border {
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(229, 184, 88, 0.16);
  border-radius: calc(var(--radius-xl) - 6px);
  pointer-events: none;
}

/* Contenu couverture épurée */
.cover-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 380px;
  width: 100%;
}

/* Emblème flocon géométrique minimaliste */
.cover-emblem {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(229, 184, 88, 0.08);
  border: 1px solid rgba(229, 184, 88, 0.25);
  color: var(--card-gold);
  margin-bottom: 2px;
  box-shadow: 0 0 25px rgba(229, 184, 88, 0.15);
  transition: transform 0.4s ease;
}

.cover-cover:hover .cover-emblem {
  transform: rotate(30deg);
}

.nordic-star-svg {
  width: 32px;
  height: 32px;
}

/* Typographie moderne */
.cover-tagline {
  font-family: var(--font-royal);
  font-size: 0.74rem;
  letter-spacing: 4px;
  font-weight: 600;
  color: var(--card-gold);
  opacity: 0.85;
}

.cover-header-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.cover-title-modern {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  line-height: 1.15;
  color: #ffffff;
  background: linear-gradient(180deg, #ffffff 40%, #e8d7b3 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
}

.cover-subtitle {
  font-size: 0.92rem;
  font-weight: 400;
  color: rgba(248, 250, 252, 0.75);
  letter-spacing: 0.3px;
  line-height: 1.4;
  margin: 0;
}

/* Séparateur ultra-fin */
.cover-divider {
  width: 50px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(229, 184, 88, 0.55), transparent);
  margin: 4px 0;
}

.cover-curator {
  font-size: 0.85rem;
  color: rgba(248, 250, 252, 0.6);
  letter-spacing: 0.4px;
  margin-bottom: 10px;
}

.curator-name {
  color: var(--card-gold-light);
  font-weight: 500;
}

/* Bouton d'ouverture élégant & contemporain */
.btn-open-modern {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(229, 184, 88, 0.12);
  border: 1px solid rgba(229, 184, 88, 0.45);
  color: #ffffff;
  padding: 13px 28px;
  border-radius: 40px;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.6px;
  cursor: pointer;
  overflow: hidden;
  outline: none;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-open-sparkle {
  color: var(--card-gold);
  font-size: 0.85rem;
}

.btn-open-arrow {
  display: inline-flex;
  align-items: center;
  color: var(--card-gold-light);
  transition: transform 0.25s ease;
}

.btn-shine-effect {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: skewX(-20deg);
  transition: left 0.75s ease;
  pointer-events: none;
}

.btn-open-modern:hover {
  background: rgba(229, 184, 88, 0.24);
  border-color: var(--card-gold);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4), 0 0 25px rgba(229, 184, 88, 0.35);
}

.btn-open-modern:hover .btn-shine-effect {
  left: 150%;
}

.btn-open-modern:hover .btn-open-arrow {
  transform: translateX(4px);
}

.btn-open-modern:active {
  transform: translateY(0);
}

/* ===================================================================
   2. INTÉRIEUR DE LA CARTE (VOLET OUVERT)
   =================================================================== */
.card-inside {
  display: none;
  width: 100%;
  height: 80vh;
  max-height: 820px;
  min-height: 540px;
  background-color: var(--card-inside-bg);
  background-image: radial-gradient(#e5b858 0.75px, transparent 0.75px), radial-gradient(#e5b858 0.75px, #fffbf5 0.75px);
  background-size: 30px 30px;
  background-position: 0 0, 15px 15px;
  border-radius: var(--radius-xl);
  border: 3px solid var(--card-gold);
  box-shadow: var(--shadow-lux), 0 0 0 10px rgba(74, 18, 26, 0.4);
  overflow: hidden;
  grid-template-columns: 360px minmax(0, 1fr);
  animation: openCardReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.card-3d-wrapper.opened .card-inside {
  display: grid;
}

@keyframes openCardReveal {
  0% {
    opacity: 0;
    transform: scale(0.85) rotateX(15deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotateX(0deg);
  }
}

/* PANNEAU DE GAUCHE : MESSAGE & SALUTATION */
.inside-left-panel {
  background: linear-gradient(180deg, #fefcf9 0%, #f9f4ec 100%);
  border-right: 2px dashed rgba(229, 184, 88, 0.5);
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 36px 30px;
  overflow-y: auto;
}

.left-panel-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Timbre vintage Pôle Nord */
.vintage-stamp {
  align-self: flex-end;
  border: 2px dashed #b91c1c;
  background: #fff;
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-royal);
  font-size: 0.65rem;
  font-weight: 700;
  color: #b91c1c;
  transform: rotate(5deg);
  box-shadow: 2px 3px 8px rgba(0,0,0,0.1);
  margin-bottom: 15px;
}

.stamp-icon {
  font-size: 1.2rem;
  margin: 2px 0;
}

.left-header {
  margin-bottom: 20px;
}

.tree-mini {
  font-size: 1.8rem;
  display: inline-block;
  margin-bottom: 6px;
}

.inside-greeting-title {
  font-family: var(--font-festive);
  font-size: 2.8rem;
  color: #991b1b;
  line-height: 1.1;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.1);
}

.inside-letter-body {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.7;
  color: #3f2a1d;
  margin-bottom: 24px;
}

.inside-author-signature {
  margin-bottom: 26px;
}

.inside-author-signature span {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

.author-handwritten {
  font-family: var(--font-festive);
  font-size: 2.2rem;
  color: #1b4332;
  margin-top: 4px;
}

/* Boîte récapitulative */
.gifts-summary-box {
  background: #fff;
  border: 1px solid rgba(229, 184, 88, 0.4);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.summary-metric {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.metric-number {
  font-family: var(--font-royal);
  font-size: 1.8rem;
  font-weight: 700;
  color: #b91c1c;
}

.metric-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dark);
}

.summary-note {
  font-size: 0.8rem;
  line-height: 1.45;
  color: #555;
}

.summary-note em {
  font-style: normal;
  color: #1b4332;
  font-weight: 500;
}

/* Bouton refermer la carte */
.btn-close-card {
  margin-top: auto;
  background: transparent;
  border: 1px solid rgba(185, 28, 28, 0.3);
  color: #991b1b;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-close-card:hover {
  background: #991b1b;
  color: #fff;
}

/* ===================================================================
   PANNEAU DE DROITE : CATALOGUE D'IDÉES CADEAUX
   =================================================================== */
.inside-right-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #fffbf5;
}

.btn-corner-close {
  position: absolute;
  top: 14px;
  right: 18px;
  z-index: 10;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.9);
  color: #64748b;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.btn-corner-close:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
  transform: rotate(90deg);
}

.right-panel-header {
  padding: 26px 30px 16px 30px;
  border-bottom: 1px solid rgba(229, 184, 88, 0.3);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
}

.header-titles {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.badge-tree {
  font-size: 0.85rem;
  font-weight: 600;
  background: #fef2f2;
  color: #b91c1c;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(185, 28, 28, 0.2);
}

.catalog-title {
  font-family: var(--font-royal);
  font-size: 1.6rem;
  color: #2d1810;
  font-weight: 700;
}

/* Onglets de filtres */
.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.category-tabs::-webkit-scrollbar {
  height: 4px;
}
.category-tabs::-webkit-scrollbar-thumb {
  background: rgba(229, 184, 88, 0.4);
  border-radius: 4px;
}

.cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #4b5563;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.cat-tab:hover {
  border-color: var(--card-gold);
  color: var(--text-dark);
  background: #fffdfa;
}

.cat-tab.active {
  background: #1b4332;
  border-color: #1b4332;
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(27, 67, 50, 0.25);
}

/* Grille défilante des cadeaux */
.gifts-scroll-wrapper {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: scroll;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 24px 30px;
  scrollbar-width: thin;
  scrollbar-color: #d4af37 #f5eee4;
}

.gifts-scroll-wrapper::-webkit-scrollbar {
  width: 9px;
  display: block;
}

.gifts-scroll-wrapper::-webkit-scrollbar-track {
  background: #f5eee4;
  border-radius: 8px;
  margin: 6px 0;
}

.gifts-scroll-wrapper::-webkit-scrollbar-thumb {
  background: #d4af37;
  border-radius: 8px;
  border: 2px solid #f5eee4;
}

.gifts-scroll-wrapper::-webkit-scrollbar-thumb:hover {
  background: #b5892b;
}

.gifts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* Carte cadeau individuelle */
.gift-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid rgba(229, 184, 88, 0.35);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.gift-card:hover {
  transform: translateY(-4px);
  border-color: var(--card-gold);
  box-shadow: 0 10px 24px rgba(229, 184, 88, 0.15), 0 4px 12px rgba(0, 0, 0, 0.06);
}

.gift-card.reserved {
  background: #f0fdf4;
  border-color: #86efac;
}

.gift-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.gift-icon-bubble {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #fefce8;
  border: 1px solid rgba(229, 184, 88, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.gift-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.gift-priority-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 12px;
  background: #fee2e2;
  color: #991b1b;
}

.gift-price-badge {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1b4332;
  background: #ecfdf5;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid rgba(27, 67, 50, 0.15);
}

.gift-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: #1a1a1a;
  margin-bottom: 8px;
  line-height: 1.35;
  font-weight: 600;
}

.gift-description {
  font-size: 0.88rem;
  color: #4b5563;
  line-height: 1.5;
  margin-bottom: 12px;
  flex: 1;
}

.gift-note-box {
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  padding: 6px 10px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.78rem;
  color: #78350f;
  margin-bottom: 16px;
  line-height: 1.4;
}

/* Actions du cadeau */
.gift-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.btn-gift-link {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.btn-gift-link:hover {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.btn-reserve {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-reserve:hover {
  background: #ecfdf5;
  border-color: #10b981;
  color: #047857;
}

.btn-reserve.is-reserved {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
  font-weight: 600;
}

/* Ruban discret "Réservé" */
.reserved-ribbon {
  position: absolute;
  top: 12px;
  left: -28px;
  background: #10b981;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 30px;
  transform: rotate(-45deg);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  letter-spacing: 0.5px;
}

/* Pied de page du panneau droit */
.inside-right-footer {
  padding: 12px 30px;
  background: #ffffff;
  border-top: 1px solid rgba(229, 184, 88, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-scroll-top {
  background: none;
  border: none;
  color: #1b4332;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
}
.btn-scroll-top:hover {
  text-decoration: underline;
}

/* ===================================================================
   MODAL DE RÉSERVATION CENTRALISÉE (PHP)
   =================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(6, 11, 20, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(229, 184, 88, 0.5);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(229, 184, 88, 0.15);
  padding: 32px 28px;
  transform: translateY(20px) scale(0.96);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1f5f9;
  border: none;
  color: #64748b;
  font-size: 0.95rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.modal-header {
  text-align: center;
  margin-bottom: 22px;
}

.modal-icon {
  font-size: 2.4rem;
  display: inline-block;
  margin-bottom: 8px;
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: #1a1a1a;
  margin-bottom: 6px;
}

.modal-subtitle {
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.5;
}

.modal-body {
  display: flex;
  flex-direction: column;
}

.modal-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 8px;
}

.modal-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: #0f172a;
  margin-bottom: 20px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-input:focus {
  border-color: #15803d;
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.15);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn-modal-cancel {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-modal-cancel:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-modal-confirm {
  background: linear-gradient(135deg, #15803d 0%, #166534 100%);
  border: 1px solid #14532d;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(21, 128, 61, 0.25);
}

.btn-modal-confirm:hover {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(21, 128, 61, 0.35);
}

.btn-modal-danger {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-modal-danger:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}

.unreserve-info {
  font-size: 0.95rem;
  color: #1e293b;
  margin-bottom: 8px;
  line-height: 1.5;
}

.unreserve-sub {
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 20px;
}

/* ===================================================================
   NOTIFICATION TOAST & CONFETTIS
   =================================================================== */
.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  background: #0f172a;
  color: #fff;
  padding: 12px 20px;
  border-radius: 30px;
  border: 1px solid var(--card-gold);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.toast-notification.show {
  opacity: 1;
  transform: translateY(0);
}

.confetti-particle {
  position: fixed;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  z-index: 999;
  pointer-events: none;
  animation: confettiFall 2.4s ease-out forwards;
}

@keyframes confettiFall {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(0.6);
    opacity: 0;
  }
}

/* ===================================================================
   RESPONSIVE DESIGN (TABLETTES & SMARTPHONES)
   =================================================================== */
@media (max-width: 960px) {
  .card-inside {
    grid-template-columns: 1fr;
    height: auto;
    max-height: 88vh;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #d4af37 #f5eee4;
  }

  .inside-left-panel {
    border-right: none;
    border-bottom: 2px dashed rgba(229, 184, 88, 0.5);
    padding: 26px 20px;
    height: auto;
    overflow: visible;
  }

  .inside-right-panel {
    height: auto;
    overflow: visible;
  }

  .right-panel-header {
    padding: 20px;
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .gifts-scroll-wrapper {
    padding: 20px;
    overflow-y: visible;
    flex: none;
  }

  .card-cover {
    min-height: 480px;
    padding: 36px 20px;
  }

  .cover-title-modern {
    font-size: 2.1rem;
  }
}

@media (max-width: 640px) {
  .top-bar {
    padding: 12px 16px;
  }

  .btn-control .label {
    display: none;
  }

  .btn-control {
    padding: 8px 10px;
  }

  .card-stage {
    padding: 10px 10px 40px 10px;
  }

  .card-cover {
    min-height: 440px;
    padding: 30px 18px;
  }

  .cover-title-modern {
    font-size: 1.85rem;
  }

  .cover-subtitle {
    font-size: 0.85rem;
  }

  .gifts-grid {
    grid-template-columns: 1fr;
  }
}
