* {
  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(255, 80, 80);
  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(255, 80, 80);
  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(255, 80, 80);
  --glow-spread-color: rgba(255, 80, 80, 0.2);
  --enhanced-glow-color: rgb(255, 150, 150);
  --btn-color: rgb(136, 40, 40);

  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: #ff9999;
}

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: #ff6666;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 0 10px #ff6666;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.4);
  z-index: 999;
}

section {
  margin-bottom: 60px;
}

section h2 {
  --glow-color: rgb(255, 80, 80);
  --glow-spread-color: rgba(255, 80, 80, 0.2);
  --btn-color: rgb(136, 40, 40);
  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(255, 80, 80);
  text-shadow: 0 0 .5em var(--glow-color);
  width: 600px;
  height: 500px;
  background: #1a1a1a;
  border-radius: 10px;
  box-shadow: 0 0 10px #ff4d4d;
  padding: 10px;
  text-align: center;
  transition: transform 0.3s ease;
  position: relative;
  overflow: hidden;
}

.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: #ff4d4d;
  border: none;
  border-radius: 20px;
  color: white;
  cursor: pointer;
  box-shadow: 0 0 10px #ff4d4d;
}

.card button:hover {
  background-color: #ff1a1a;
}

/* Badge promo diagonal */
.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;
}

button {
  --glow-color: rgb(255, 80, 80);
  --glow-spread-color: rgba(255, 80, 80, 0.2);
  --enhanced-glow-color: rgb(255, 150, 150);
  --btn-color: rgb(136, 40, 40);

  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(136, 40, 40);
  border-radius: 50%;
  box-shadow: 0 0 6px 2px rgba(255, 80, 80, 0.2);
  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: rgb(136, 40, 40);
  color: white;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s;
  white-space: nowrap;
}

.actions a button:hover {
  background-color: rgb(255, 80, 80);
}

.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: 100px 20px 60px;
  }
}

/* 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; }
  body { overflow-x: hidden; }
  .footer { height: 50px; font-size: 12px; }
}

@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; }
}

/* macOS optimizations */
@media screen and (min-width: 1024px) and (max-width: 1440px) {
  body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  }
  
  main {
    padding: 130px 40px 90px;
  }
  
  .top-bar {
    height: 70px;
    font-size: 32px;
  }
}

@media screen and (min-width: 1440px) {
  body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, sans-serif;
  }
  
  main {
    padding: 140px 50px 100px;
  }
  
  .top-bar {
    height: 75px;
    font-size: 34px;
  }
}

/* Windows/Linux - 1920x1080 Full HD */
@media (min-width: 1920px) and (max-width: 2560px) {
  main {
    padding: 145px 75px 105px;
  }
  
  .card {
    width: 650px;
    height: 520px;
  }
  
  .gallery-grid {
    gap: 60px;
  }
}

/* Windows/Linux - 2K/4K */
@media (min-width: 2560px) {
  main {
    padding: 160px 100px 120px;
  }
  
  .top-bar {
    height: 85px;
    font-size: 42px;
  }
  
  .card {
    width: 700px;
    height: 580px;
  }
}

/* iOS - iPhone toutes tailles */
@media (max-width: 430px) and (orientation: portrait) {
  main {
    padding-top: calc(100px + env(safe-area-inset-top, 0));
  }
}

/* iOS - iPad */
@media (min-width: 768px) and (max-width: 1024px) and (-webkit-min-device-pixel-ratio: 2) {
  main {
    padding: 115px 30px 70px;
  }
  
  .card {
    width: 48%;
  }
}

/* Custom scrollbar for macOS Safari */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #1a1a1a;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: #ff4d4d;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #ff6666;
}

/* Input and button appearance fixes for Safari */
input, 
button, 
select, 
textarea {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

button {
  -webkit-tap-highlight-color: transparent;
}
