/*
Theme Name: DachDeals V9 (The Legacy)
Theme URI: https://dachdeals.de
Description: The truly final version with corrected meta fields and improved UI.
Version: 9.0
Author: Michael
*/

:root {
  --background: #080808;
  --card: #141414;
  --card-hover: #1c1c1c;
  --accent: #FF9900;
  --accent-glow: rgba(255, 153, 0, 0.15);
  --text-main: #FFFFFF;
  --text-dim: #999999;
  --border: #222222;
  --nav-bg: rgba(10, 10, 10, 0.8);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--background);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

.wrapper {
  padding-top: 140px;
  min-height: 100vh;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
}

/* Premium Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 25px 0;
}

.nav-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.logo {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -1.5px;
  text-decoration: none;
  color: #fff;
  display: inline-block;
}

.logo span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 30px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-link {
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s;
  cursor: pointer;
  background: none;
  border: none;
  padding: 5px 0;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent);
}

.search-container {
  width: 100%;
  max-width: 600px;
  position: relative;
  margin-top: 10px;
}

.search-input {
  width: 100%;
  background: #1a1a1a;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 24px;
  color: white;
  font-size: 1rem;
  outline: none;
  transition: all 0.3s;
  text-align: center;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
  background: #222;
}

/* Grid Layout */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
  padding: 40px 0 100px 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-8px);
  border-color: var(--accent);
  background: var(--card-hover);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.card-top {
  height: 240px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  position: relative;
}

.card-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s;
}

.card:hover .card-image {
  transform: scale(1.05);
}

.card-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #fff;
  line-height: 1.4;
  text-decoration: none;
}

.card-title a {
  color: inherit;
  text-decoration: none;
}

.price-box {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
  margin-top: auto;
}

.new-price {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
}

.old-price {
  text-decoration: line-through;
  color: var(--text-dim);
  font-size: 1rem;
}

.discount-tag {
  position: absolute;
  top: 15px;
  right: 15px;
  background: #FF2E2E;
  color: #fff;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  box-shadow: 0 4px 15px rgba(255, 46, 46, 0.4);
  z-index: 10;
}

.country-tag {
  position: absolute;
  top: 15px;
  left: 15px;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  color: #fff;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  z-index: 10;
}

.buy-btn {
  display: block;
  width: 100%;
  background: var(--accent);
  color: #000;
  text-align: center;
  padding: 18px;
  border-radius: 16px;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.1rem;
  transition: all 0.3s;
}

.buy-btn:hover {
  background: #fff;
  box-shadow: 0 0 20px var(--accent-glow);
}

/* Custom Dropdown Styling - V8 FIXED */
.custom-dropdown {
  position: relative;
  display: inline-block;
  padding-bottom: 10px;
  /* Bridge to menu */
  margin-bottom: -10px;
  /* Compensation */
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 5px 0;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  border: 1px solid var(--border);
  border-radius: 12px;
  min-width: 160px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  z-index: 2000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s;
  /* Removed margin-top to close gap */
  margin-top: 0;
}

.custom-dropdown:hover .dropdown-menu {
  display: block;
  opacity: 1;
}

.dropdown-item {
  display: block;
  padding: 12px 20px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-dim);
  transition: all 0.2s;
  text-decoration: none;
  border-bottom: 1px solid #222;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: var(--card-hover);
  color: #fff;
}

/* Hot Card Styles */
.card.hot-card {
  border-color: #ff2e2e;
  background: linear-gradient(145deg, #141414, #1a0a0a);
}

.card.hot-card:hover {
  box-shadow: 0 20px 40px rgba(255, 46, 46, 0.2);
}

.discount-tag.hot-tag {
  background: #FF2E2E;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 46, 46, 0.7);
  }

  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(255, 46, 46, 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 46, 46, 0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.6s ease forwards;
}

/* Pagination */
.pagination {
  text-align: center;
  margin-top: 50px;
  padding-bottom: 50px;
}

.page-numbers {
  display: inline-block;
  padding: 10px 15px;
  margin: 0 5px;
  background: #1a1a1a;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  border: 1px solid #333;
  font-weight: bold;
}

.page-numbers.current,
.page-numbers:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}