* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background-color: #0d0d0d;
  color: white;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Ubuntu, Arial, sans-serif;
  display: flex;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

.top-bar {
  --glow-color: rgb(217, 176, 255);
  text-shadow: 0 0 .5em var(--glow-color);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background-color: #222;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: bold;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.wishlist-btn {
  --glow-color: rgb(167, 173, 255);
  --glow-spread-color: rgba(71, 58, 255, 0.1);
  --btn-color: rgb(21, 0, 127);

  position: fixed;
  top: 12px;     
  right: 20px;   
  z-index: 2000; 

  font-size: 15px;
  font-weight: bold;
  padding: 8px 14px;
  color: var(--glow-color);
  background-color: var(--btn-color);
  border: .25em solid var(--glow-color);
  border-radius: 1em;
  text-shadow: 0 0 .5em var(--glow-color);
  box-shadow:
    0 0 1em .25em var(--glow-color),
    0 0 4em 1em var(--glow-spread-color),
    inset 0 0 .75em .25em var(--glow-color);
  cursor: pointer;
  transition: all 0.3s;
}

.wishlist-btn:hover {
  color: var(--btn-color);
  background-color: var(--glow-color);
  box-shadow:
    0 0 1em .25em var(--glow-color),
    0 0 4em 2em var(--glow-spread-color),
    inset 0 0 .75em .25em var(--glow-color);
}

.sidebar {
  --glow-color: rgb(217, 176, 255);
  text-shadow: 0 0 .5em var(--glow-color);
  text-align: center;
  margin-top: 60px;
  width: 300px;
  height: 100vh;
  height: 100dvh; /* Support iOS */
  min-height: -webkit-fill-available;
  padding:  10px;
  background-color: #111;
  color: white;
  box-sizing: border-box;
}

.sidebar h2,
.sidebar h3,
.sidebar h4 {
  font-size: 28px;
  margin-bottom: 20px;
}

.sidebar a {
  --glow-color: rgb(217, 176, 255);
  --glow-spread-color: rgba(191, 123, 255, 0.1);
  --enhanced-glow-color: rgb(231, 206, 255);
  --btn-color: rgb(100, 61, 136);

  display: block;
  margin-bottom: 20px;
  margin-left: 50px;
  padding: 15px;
  left: -30px;
  font-size: 17px;
  font-weight: bold;
  text-align: center;
  color: var(--glow-color);
  background-color: var(--btn-color);
  border: .25em solid var(--glow-color);
  border-radius: 1em;
  outline: none;
  text-shadow: 0 0 .5em var(--glow-color);
  box-shadow:
    0 0 1em .25em var(--glow-color),
    0 0 4em 1em var(--glow-spread-color),
    inset 0 0 .75em .25em var(--glow-color);
  position: relative;
  transition: all 0.3s;
}

.sidebar a:hover {
  background-color: rgb(231, 206, 255);
}

main {
  margin-left: 320px;
  padding: 120px 30px 80px;
  flex: 1;
}

.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40px;
  background-color: #1b1b1b;
  color: #a58eff;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 0 10px #a58eff;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.4);
  z-index: 999;
}

section {
  margin-bottom: 60px;
}

section h2 {
      --glow-color: rgb(217, 176, 255);
  --glow-spread-color: rgba(191, 123, 255, 0.1);
  --btn-color: rgb(100, 61, 136);
  font-size: 2.1rem;
  margin-bottom: 20px;
  padding-right: 550px;
  text-align: center;
    color: var(--glow-color);
  text-shadow: 0 0 .5em var(--glow-color);
  text-decoration: underline;
  transition: all 0.3s;
}

section h3 {
  font-size: 2.5em;
  margin: 10px 0;
  color: #fff;
  text-shadow: 0 0 .5em var(--glow-color);
  text-decoration: none;
  transition: all 0.3s;
}

.gallery-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding-right: 550px;
  gap: 50px;
  max-width: calc(3 * 900px + 2 * 20px);
  margin: 20px auto 0 auto; 
}

.card {
  --glow-color: rgb(217, 176, 255);
  text-shadow: 0 0 .5em var(--glow-color);
  width: 600px;
  height: 500px;
  background: #1a1a1a;
  border-radius: 10px;
  box-shadow: 0 0 10px #a58eff;
  padding: 10px;
  text-align: center;
  transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
}

  /* Badge de promotion en diagonale */
  .promo-ribbon {
    position: absolute;
    top: 20px;
    right: -40px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff3838 100%);
    color: white;
    padding: 8px 50px;
    font-size: 1.2em;
    font-weight: bold;
    transform: rotate(45deg);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    z-index: 10;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
  }

.card:hover {
  transform: scale(1.05);
}

.card img {
  width: 100%;
  border-radius: 30px;
}

.card h2 {
  font-size: 2.5em;
  margin: 10px 0;
  color: #fff;
}

.card button {
  font-size: 1.5em;
  padding: 12px 100px;
  background-color: #b57fff;
  border: none;
  border-radius: 20px;
  color: white;
  cursor: pointer;
  box-shadow: 0 0 10px #b57fff;
}

.card button:hover {
  background-color: #a366ff;
}

button {
  --glow-color: rgb(217, 176, 255);
  --glow-spread-color: rgba(191, 123, 255, 0.1);
  --enhanced-glow-color: rgb(231, 206, 255);
  --btn-color: rgb(100, 61, 136);

  position: relative;
  top: 4%;
  padding: 0.4rem 0.6rem;
  font-size: 15px;
  font-weight: bold;
  color: var(--glow-color);
  background-color: var(--btn-color);
  border: .25em solid var(--glow-color);
  border-radius: 1em;
  outline: none;
  text-shadow: 0 0 .5em var(--glow-color);
  box-shadow:
    0 0 1em .25em var(--glow-color),
    0 0 4em 1em var(--glow-spread-color),
    inset 0 0 .75em .25em var(--glow-color);
  transition: all 0.3s;
}

#stars-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgb(100, 61, 136);
  border-radius: 50%;
  box-shadow: 0 0 6px 2px rgba(191, 123, 255, 0.1);
  opacity: 0;
  animation: twinkle 2s infinite ease-in-out;
}

.actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.actions a button {
  padding: 8px 16px;
  border: none;
  border-radius: 10px;
  background-color: #a58eff;
  color: white;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s;
  white-space: nowrap;
}

.actions a button:hover {
  background-color: #cbb2ff;
}

.wishlist-star {
  align-items: center;
  position: relative;
  font-size: 50px;
  cursor: pointer;
  color: gold;
  transition: transform 0.2s;
  flex-shrink: 0;
  line-height: 1;
}

.wishlist-star.active {
  color: gold;
  text-shadow: 0 0 15px gold;
}

.wishlist-star:hover {
  transform: scale(1.2);
}

@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.4); }
}


@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  main {
    margin-left: 0;
    padding: 80px 20px 20px;
  }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .top-bar { height: 50px; font-size: 18px; padding: 0 8px; }
  .wishlist-btn { display: none; }

  section h2 { padding-right: 0; font-size: 1.4rem; }
  section h3 { font-size: 1.2em; }

  .gallery-grid {
    padding-right: 0;
    gap: 10px;
    max-width: 100%;
  }

  .card {
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0 8px;
  }

  .card img { border-radius: 12px; height: 180px; object-fit: cover; }
  .card h2 { font-size: 1.1em; margin: 6px 0; }
  .card button { font-size: 0.9em; padding: 8px 16px; }
  
  .promo-ribbon {
    font-size: 0.8em;
    padding: 5px 35px;
    top: 15px;
    right: -35px;
  }

  .actions { gap: 10px; flex-direction: row; align-items: center; justify-content: center; }
  .actions a button { width: auto; }
  .wishlist-star { font-size: 24px; }
}

@media (max-width: 480px) {
  .card { max-width: 100%; }
  .card button { width: 100%; }
}

/* Tablet layout */
@media (min-width: 600px) and (max-width: 1024px) {
  .top-bar { height: 56px; font-size: 24px; }
  .wishlist-btn { top: 10px; right: 16px; font-size: 14px; padding: 7px 12px; }

  section h2 { padding-right: 0; font-size: 1.8rem; }
  section h3 { font-size: 1.8em; }

  .gallery-grid {
    padding-right: 0;
    gap: 24px;
    max-width: 100%;
  }

  .card {
    width: 48%;
    max-width: 560px;
    height: auto;
    margin: 0;
  }

  .card img { border-radius: 16px; }
  .card h2 { font-size: 1.6em; }
  .card button { font-size: 1.1em; padding: 10px 28px; }

  .actions { gap: 32px; }
  .footer { height: 52px; font-size: 13px; }

  .wishlist-star { font-size: 36px; }
}
/* ========== Optimisations Safari/macOS ========== */

html {
  -webkit-scroll-behavior: smooth;
  scroll-behavior: smooth;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(217, 176, 255, 0.05);
}

::-webkit-scrollbar-thumb {
  background: rgba(217, 176, 255, 0.4);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(217, 176, 255, 0.7);
}

input, textarea, select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  font-size: 16px;
  border-radius: 6px;
}

button, .wishlist-btn {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-tap-highlight-color: transparent;
}

button:active, .wishlist-btn:active {
  -webkit-transform: scale(0.98);
  transform: scale(0.98);
}

/* Optimisation pour MacBook */
@media (min-width: 1440px) {
  main {
    padding: 140px 60px 100px;
  }

  .gallery-grid {
    gap: 30px;
    max-width: 100%;
  }

  .card {
    max-width: 450px;
  }
}

@media (min-width: 1024px) and (max-width: 1440px) {
  main {
    padding: 120px 40px 80px;
  }

  .gallery-grid {
    gap: 28px;
  }
}

/* Windows - 1366x768 (laptop le plus commun) */
@media (min-width: 1366px) and (max-width: 1440px) and (min-height: 700px) and (max-height: 800px) {
  main { padding: 125px 35px 75px; }
}

/* Windows/Linux - 1920x1080 Full HD */
@media (min-width: 1920px) and (max-width: 2560px) {
  main { padding: 145px 70px 95px; }
  .top-bar { height: 75px; font-size: 36px; }
  .card { max-width: 520px; height: 540px; }
}

/* Windows/Linux - 2K/4K */
@media (min-width: 2560px) {
  main { padding: 165px 100px 115px; }
  .top-bar { height: 85px; font-size: 42px; }
}

/* iOS - iPhone (Safe Area) */
@media (max-width: 430px) and (orientation: portrait) {
  main {
    padding-top: calc(100px + env(safe-area-inset-top, 0));
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0));
  }
}

/* iOS - iPad Retina */
@media (min-width: 768px) and (max-width: 1024px) and (-webkit-min-device-pixel-ratio: 2) {
  main { padding: 115px 35px 70px; }
}