/* ======================================================================= */
/* SEARCH BASE CSS - Grundlegende Styles, Variablen & Layout              */
/* ======================================================================= */

:root {
  --primary: #c77dff;
  --primary-dark: #9c27b0;
  --accent: #ff6b9d;
  --bg-dark: #0a0a0a;
  --bg-light: #1a1a1a;
  --bg-card: #141414;
  --text: #ffffff;
  --text-secondary: #aaa;
  --border: #2a2a2a;
  --glow: rgba(199, 125, 255, 0.4);
  --success: #4caf50;
  --warning: #ff9800;
  --error: #f44336;
  --like-red: #ff4757;
  --like-red-hover: #ff3742;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  /* Entfernt das blaue Aufleuchten beim Tippen auf Mobile */
}

body {
  background: var(--bg-dark);
  color: var(--text);
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ======================================================================= */
/* CUSTOM SCROLLBAR                                                       */
/* ======================================================================= */
::-webkit-scrollbar {
  width: 8px;
  height: 4px;
  /* Dünner für horizontales Scrollen auf Desktop */
}

::-webkit-scrollbar-track {
  background: #111;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(45deg, var(--primary), var(--accent));
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(199, 125, 255, 0.5);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(45deg, var(--accent), var(--primary));
}

/* ======================================================================= */
/* HEADER - GLASSMORPHISM ENHANCED                                        */
/* ======================================================================= */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  /* Echter Glassmorphismus Effekt */
  background: rgba(15, 15, 15, 0.65);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);

  /* Feine Kante unten statt hartem Border */
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);

  /* Sanfter Schatten für Tiefe */
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);

  transition: all 0.3s ease;
}

header.scrolled {
  background: rgba(10, 10, 10, 0.85);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.logo-container {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo {
  height: 60px;
  width: auto;
  filter: drop-shadow(0 0 20px rgba(199, 125, 255, 0.5));
  transition: all 0.3s ease;
  transform: scale(1);
}

.logo:hover {
  filter: drop-shadow(0 0 25px rgba(199, 125, 255, 0.8));
  transform: scale(1.05);
}

.logo-fallback {
  display: none;
  color: var(--primary);
  font-weight: 900;
  font-size: 32px;
  text-shadow: 0 0 15px rgba(199, 125, 255, 0.6);
}

nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-shrink: 0;
}

.nav-btn {
  position: relative;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.6rem 1.2rem;
  border-radius: 12px;
  transition: all 0.3s ease;
  font-weight: 500;
  overflow: hidden;
  font-size: 0.95rem;
}

.nav-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
  text-shadow: 0 0 8px rgba(199, 125, 255, 0.5);
}

/* ======================================================================= */
/* MAIN LAYOUT                                                             */
/* ======================================================================= */
main {
  min-height: 100vh;
  padding: 2rem;
}

.content {
  max-width: 1400px;
  margin: 0 auto;
}

/* ======================================================================= */
/* HERO SECTION                                                           */
/* ======================================================================= */
.hero-section {
  text-align: center;
  margin-bottom: 3rem;
  padding-top: 2rem;
}

.search-brand-container {
  margin-bottom: 1rem;
}

.search-brand-title {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.brand-text {
  background: linear-gradient(135deg, var(--primary) 0%, #ffffff 50%, var(--primary) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -1px;
}

.search-text {
  background: linear-gradient(135deg, #ffffff 0%, var(--accent) 50%, #ffffff 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  font-size: 0.7em;
}

.search-brand-subtitle {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-secondary);
  text-transform: lowercase;
  letter-spacing: 1px;
  margin-bottom: 2rem;
  opacity: 0.8;
}

.gradient-heading {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 900;
  margin-bottom: 1rem;
  background: linear-gradient(45deg, var(--primary), var(--accent), #ffffff);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.search-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
}

/* NEU: Highlight für die Produkt-Zahl */
#totalProductsCount {
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary, #c77dff) 0%, var(--accent, #ff6b9d) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--primary);
  /* Fallback */
  display: inline-block;
  min-width: 60px;
  /* Verhindert Springen */
  text-align: center;
  filter: drop-shadow(0 0 15px rgba(199, 125, 255, 0.4));
  /* Schönes Leuchten */
  transform: translateZ(0);
  /* Performance */
}

/* ======================================================================= */
/* SEARCH CONTAINER                                                        */
/* ======================================================================= */
.search-container {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 600px;
}

.search-input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  background: var(--bg-light);
  border: 2px solid var(--border);
  border-radius: 25px;
  color: var(--text);
  font-size: 1rem;
  transition: all 0.3s ease;
  outline: none;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(199, 125, 255, 0.1);
  transform: translateY(-2px);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: var(--text-secondary);
}

.filter-toggle {
  position: relative;
  padding: 1rem 1.5rem;
  background: var(--bg-light);
  border: 2px solid var(--border);
  border-radius: 25px;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  min-width: 120px;
}

.filter-toggle:hover {
  border-color: var(--primary);
  background: rgba(199, 125, 255, 0.1);
  transform: translateY(-2px);
}

.filter-toggle.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ======================================================================= */
/* CATEGORY BUTTONS                                                        */
/* ======================================================================= */
.category-section {
  margin-bottom: 2rem;
}

.category-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.category-btn {
  position: relative;
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--border);
  border-radius: 25px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
  /* Verhindert Umbruch in Buttons */
}

.category-btn:hover,
.category-btn.active,
.category-btn.expanded {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

.category-btn.active {
  background: rgba(199, 125, 255, 0.1);
}

.category-btn.womens-active {
  background: rgba(255, 105, 180, 0.15) !important;
  border-color: #ff69b4 !important;
  color: #ff69b4 !important;
  box-shadow: 0 0 15px rgba(255, 105, 180, 0.3);
}

/* ======================================================================= */
/* PRODUCTS GRID                                                           */
/* ======================================================================= */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.4s ease;
  cursor: pointer;
  position: relative;
  -webkit-touch-callout: none;
  /* Verhindert Context Menu bei langem Drücken auf iOS */
}

.product-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--primary);
  box-shadow: 0 20px 40px rgba(199, 125, 255, 0.2);
}

.product-image-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  /* Quadratisch für Konsistenz */
  height: auto;
  overflow: hidden;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-image:hover {
  transform: scale(1.1);
}

.product-info {
  padding: 1.5rem;
}

.product-brand {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.product-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.8em;
  /* Fixiert die Höhe für 2 Zeilen */
}

.product-price {
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.product-price::before {
  content: '$';
}

.product-label {
  display: inline-block;
  background: linear-gradient(45deg, var(--accent), #ff4757);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.product-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.product-colors {
  display: flex;
  gap: 0.25rem;
  margin: 0.5rem 0;
  flex-wrap: wrap;
}

.product-color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

/* ======================================================================= */
/* FOOTER                                                                  */
/* ======================================================================= */
footer {
  background: linear-gradient(135deg, var(--bg-dark) 0%, #1a0a1a 100%);
  padding: 3rem 2rem 2rem;
  text-align: center;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

.footer-content {
  max-width: 1000px;
  margin: 0 auto;
}

.disclaimer {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.copyright {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
}

.footer-links a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.3s ease;
}

.footer-links a:hover {
  color: var(--accent);
}

/* ======================================================================= */
/* RESPONSIVE DESIGN & MOBILE OPTIMIZATION                                 */
/* ======================================================================= */

/* Tablet & kleinere Laptops */
@media (max-width: 1024px) {
  .products-grid {
    gap: 1.5rem;
  }
}

/* Tablets & große Phones */
@media (max-width: 768px) {
  main {
    padding: 1rem 1rem 4rem 1rem;
    /* Mehr Padding unten für Floating Actions */
  }

  .header-content {
    padding: 0.8rem 1.5rem;
  }

  .logo {
    height: 52px;
    transform: scale(1);
  }

  .logo:hover {
    transform: scale(1.1);
  }

  .logo-fallback {
    font-size: 28px;
  }

  .search-brand-title {
    font-size: clamp(2.5rem, 7vw, 4rem);
  }

  /* Horizontales Scrollen für Kategorien verbessern */
  .category-buttons {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    flex-wrap: nowrap;
    /* Erzwingt eine Zeile */
    -webkit-overflow-scrolling: touch;
    /* Smooth scroll iOS */
    margin-left: -1rem;
    margin-right: -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
    gap: 0.8rem;
  }

  /* Scrollbar verstecken aber Funktion behalten */
  .category-buttons::-webkit-scrollbar {
    display: none;
  }

  .category-btn {
    flex-shrink: 0;
    min-width: auto;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
  }
}

/* ECHTE MOBILE OPTIMIERUNG (Handys) */
@media (max-width: 480px) {
  .header-content {
    padding: 0.6rem 0.8rem;
  }

  /* Logo etwas kleiner für mehr Platz */
  .logo {
    height: 44px;
  }

  nav {
    gap: 0.8rem;
  }

  .nav-btn {
    padding: 0.5rem;
    font-size: 0.85rem;
  }

  .search-input {
    padding: 0.875rem 0.875rem 0.875rem 2.5rem;
    font-size: 0.95rem;
  }

  .search-icon {
    left: 0.875rem;
    font-size: 1rem;
  }

  .hero-section {
    margin-bottom: 2rem;
  }

  .search-brand-title {
    font-size: clamp(2rem, 6vw, 3rem);
  }

  /* Filter Toggle kompakter */
  .filter-toggle {
    padding: 0.875rem 1rem;
    min-width: auto;
  }

  /* Suche und Filter nebeneinander optimieren */
  .search-container {
    gap: 0.5rem;
  }

  .search-box {
    flex: 1;
    min-width: 0;
    /* Verhindert Overflow */
  }

  /* WICHTIG: 2 Spalten auf Mobile erzwingen statt 1 */
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    /* Genau 2 Spalten */
    gap: 10px;
    /* Kleinerer Abstand spart Platz */
  }

  .product-info {
    padding: 0.8rem;
    /* Weniger Padding in der Karte */
  }

  .product-brand {
    font-size: 0.65rem;
    margin-bottom: 0.2rem;
  }

  .product-title {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    height: 2.4em;
    /* Höhe anpassen für kleinere Schrift */
  }

  .product-price {
    font-size: 1.1rem;
  }

  /* Buttons für Aktionen untereinander */
  .action-buttons {
    flex-direction: column;
    align-items: stretch;
    gap: 0.8rem;
  }

  .action-btn {
    width: 100%;
    justify-content: center;
  }
}