/* ===================== GLOBALS ===================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #000000;
  --secondary: #00ff3783;
  --background: #ffffff;
  --text: #000000;
  --muted: #aaaaaa;
  --highlight: #ffffff;
  --card-shadow: rgba(0, 0, 0, 0.5);
  --radius: 12px;
  --hero-fade-duration: 1.2s;
}

body {
  font-family: 'Roboto', sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===================== HERO SECTION ===================== */
.hero {
  height: 100vh;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), 
              url("test-bg.png");
  background-size: cover;
  background-position: center;
  position: relative;
  transition: all var(--hero-fade-duration) cubic-bezier(0.16, 1, 0.3, 1);
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 200px;
  background: linear-gradient(to bottom, transparent 0%, var(--background) 100%);
  z-index: 1;
}

.hero-brand {
  font-family: 'Montserrat', sans-serif;
  font-size: 5rem;
  color: white;
  text-align: center;
  text-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
  opacity: 1;
  transform: translateY(0);
  transition: all var(--hero-fade-duration) cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2;
}

.main-content {
  position: relative;
  z-index: 2;
  background: var(--background);
  padding: 2rem 4rem;
  max-width: 1600px;
  margin: 0 auto;
}

/* ===================== HEADER & NAVIGATION ===================== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid var(--muted);
  margin-top: 2rem;
}

.brand-name {
  font-family: 'Montserrat', sans-serif;
  font-size: 2.5rem;
  color: black;
}

.tagline {
  font-style: italic;
  color: var(--muted);
  font-size: 1rem;
}

nav {
  margin: 2rem 0;
  text-align: center;
}

nav ul {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  list-style: none;
}

.nav-button {
  position: relative;
  z-index: 1;
  overflow: hidden;
  text-decoration: none;
  color: var(--primary);
  padding: 0.6rem 1.4rem;
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  font-weight: bold;
  transition: all 0.3s ease;
  background-color: transparent;
}

.nav-button:hover {
  background: var(--primary);
  color: var(--highlight);
}

/* ===================== PRODUCT GRID ===================== */
.featured {
  text-align: center;
  margin-bottom: 4rem;
}

.section-title {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 2rem;
  font-family: 'Montserrat', sans-serif;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.5rem;
}

.item-card {
  background: var(--highlight);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 6px 20px var(--card-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.item-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.item-image {
  aspect-ratio: 4/3;
  background-size: contain; 
  background-repeat: no-repeat; /* Add this to prevent repeating if image is smaller than container */
  background-position: center;
  position: relative;
}

.price-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--secondary);
  color: #fff;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-weight: bold;
  font-size: 0.95rem;
}

.item-info {
  padding: 1.5rem;
  color: black;
  border-top: 1px solid var(--muted);
}

.item-info h4 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.item-info p {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.buy-button {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  border-radius: 4px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: bold;
  transition: all 0.3s ease;
  width: 100%;
}

.buy-button:hover {
  background: var(--primary);
  color: white;
}

/* ===================== DETAIL VIEW OVERLAY ===================== */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

.detail-container {
  position: relative;
  width: 90%;
  max-width: 1200px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.detail-container.active {
  transform: scale(1);
  opacity: 1;
  overflow: hidden;
}

.detail-view {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.detail-view .item-image {
  aspect-ratio: 1/1;
  background-size: cover;
  background-position: center;
}

.detail-view .item-info {
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--primary);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
}

/* --- HIER IST DER KORREKTE CODE FÜR DIE SEITENÜBERGANGS-ANIMATION --- */
.page-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0e0e0e; /* Deine gewünschte Dunkelfarbe */
    z-index: 99999; /* Stellt sicher, dass es über allem anderen liegt */
    opacity: 0; /* Startet transparent */
    visibility: hidden; /* Standardmäßig unsichtbar */
    /* Die CSS-Transition: opacity über die Dauer, visibility am Ende der Dauer */
    /* Dies definiert den Übergang, wenn es von 'hidden' zu 'visible' geht */
    transition: opacity 0.5s ease-out, visibility 0s 0.5s; /* 2.5s Abdunkel-Dauer */
}

/* Zustand, wenn die Animation aktiv ist (wird per JS hinzugefügt ) */
.page-transition-overlay.active {
    opacity: 1; /* Wird vollständig deckend */
    visibility: visible; /* Wird sichtbar */
    /* Dies definiert den Übergang, wenn es von 'visible' zu 'hidden' geht */
    transition: opacity 0.5s ease-out, visibility 0.5s; /* Hier wird visibility sofort sichtbar */
}
/* --- ENDE DES KORRIGIERTEN CODE-ABSCHNITTS --- */
body.no-scroll {
  overflow: hidden;
}

/* ===================== FOOTER ===================== */
footer {
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
  padding-top: 3rem;
  border-top: 2px solid var(--muted);
}

/* ===================== ANIMATIONS ===================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.item-card {
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

.item-card:nth-child(1) { animation-delay: 0.1s; }
.item-card:nth-child(2) { animation-delay: 0.2s; }
.item-card:nth-child(3) { animation-delay: 0.3s; }
.item-card:nth-child(4) { animation-delay: 0.4s; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 768px) {
  body {
    padding: 0;
  }
  
  .hero-brand {
    font-size: 3rem;
  }
  
  .main-content {
    padding: 1.5rem;
  }
  
  .detail-view {
    grid-template-columns: 1fr;
  }
  
  .detail-view .item-image {
    aspect-ratio: 4/3;
  }
  
  .detail-view .item-info {
    padding: 1.5rem;
  }
}