/*
Theme Name: DachDeals Ultimate V17
Theme URI: https://dachdeals.de
Description: Ultimate Edition V17 - External image support, non-static mobile header, compact deal view, SEO optimized.
Version: 17.0
Author: DachDeals Team
Author URI: https://dachdeals.de
License: GPL2
Text Domain: dachdeals-v17
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg: #080808;
  --bg-card: #111114;
  --bg-card-hover: #1a1a1e;
  --accent: #FF9900;
  --accent-glow: rgba(255, 153, 0, 0.15);
  --hot: #FF3B3B;
  --freebie: #00FF88;
  --text: #FFFFFF;
  --text-dim: #888888;
  --text-muted: #555555;
  --border: #1e1e22;
  --nav-bg: rgba(8, 8, 8, 0.92);
  --radius: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== HEADER - DESKTOP: Sticky, MOBILE: Relative (scrolls with page) ===== */
.site-header {
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

/* Desktop: Sticky header */
@media (min-width: 769px) {
  .site-header {
    position: sticky;
    top: 0;
  }

  .header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    height: 70px;
  }

  .site-main {
    padding-top: 30px;
  }
}

/* Mobile: Relative header - NO overlap! */
@media (max-width: 768px) {
  .site-header {
    position: relative;
    padding: 12px 0;
  }

  .header-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .header-row {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
  }

  .site-main {
    padding-top: 15px;
  }
}

/* Logo - Text Style */
.site-logo {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -1px;
  text-decoration: none;
  color: #fff;
}

.site-logo span {
  color: var(--accent);
}

@media (max-width: 768px) {
  .site-logo {
    font-size: 1.5rem;
  }
}

/* Navigation */
.main-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

@media (max-width: 768px) {
  .main-nav {
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
  }
}

.nav-link {
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.2s;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.hot {
  color: var(--hot);
}

@media (max-width: 768px) {
  .nav-link {
    font-size: 0.8rem;
    padding: 5px 10px;
  }
}

/* Search */
.header-search {
  flex: 1;
  max-width: 350px;
}

@media (max-width: 768px) {
  .header-search {
    width: 100%;
    max-width: none;
    order: 10;
  }
}

.search-input {
  width: 100%;
  background: #151518;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--accent);
}

.search-input::placeholder {
  color: var(--text-muted);
}

/* Country Pills */
.country-pills {
  display: flex;
  gap: 6px;
}

.country-pill {
  background: #151518;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s;
}

.country-pill:hover,
.country-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 130px;
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
  margin-top: 5px;
  z-index: 200;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
}

.dropdown-item {
  display: block;
  padding: 8px 12px;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s;
}

.dropdown-item:hover {
  background: var(--bg-card-hover);
  color: var(--text);
}

/* ===== DEALS GRID ===== */
.deals-grid {
  display: grid;
  gap: 16px;
  padding-bottom: 60px;
}

/* Desktop: 4 columns */
@media (min-width: 1100px) {
  .deals-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }
}

/* Tablet: 3 columns */
@media (min-width: 769px) and (max-width: 1099px) {
  .deals-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

/* Mobile: 2 columns COMPACT */
@media (max-width: 768px) {
  .deals-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

/* ===== DEAL CARD ===== */
.deal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.deal-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

/* Tags */
.deal-tags {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  z-index: 10;
  pointer-events: none;
}

.tag {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 5px;
}

.tag-country {
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  backdrop-filter: blur(5px);
}

.tag-discount {
  background: var(--hot);
  color: #fff;
}

.tag-discount.hot {
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

/* Image */
.deal-image {
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  aspect-ratio: 1;
}

@media (min-width: 769px) {
  .deal-image {
    height: 170px;
    aspect-ratio: auto;
    padding: 16px;
  }
}

.deal-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s;
}

.deal-card:hover .deal-image img {
  transform: scale(1.05);
}

/* Content */
.deal-content {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

@media (min-width: 769px) {
  .deal-content {
    padding: 16px;
  }
}

.deal-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
  transition: color 0.2s;
}

.deal-card:hover .deal-title {
  color: var(--accent);
}

@media (min-width: 769px) {
  .deal-title {
    font-size: 0.9rem;
    margin-bottom: 10px;
  }
}

/* Prices */
.deal-prices {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
  margin-bottom: 10px;
}

.price-current {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--accent);
}

.price-old {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

@media (min-width: 769px) {
  .price-current {
    font-size: 1.5rem;
  }
}

/* Button */
.deal-btn {
  display: block;
  background: var(--accent);
  color: #000;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 10px;
  border-radius: 8px;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transition: all 0.2s;
}

.deal-btn:hover {
  background: #fff;
}

@media (min-width: 769px) {
  .deal-btn {
    padding: 12px;
    font-size: 0.85rem;
  }
}

/* Hot Card */
.deal-card.is-hot {
  border-color: var(--hot);
}

.deal-card.is-hot:hover {
  box-shadow: 0 12px 30px rgba(255, 59, 59, 0.2);
}

/* Freebie Card */
.deal-card.is-freebie {
  border-color: var(--freebie);
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  transition: all 0.2s;
}

.page-numbers:hover {
  border-color: var(--accent);
  color: var(--text);
}

.page-numbers.current {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}

/* ===== FOOTER ===== */
.site-footer {
  background: #050505;
  border-top: 1px solid var(--border);
  padding: 40px 0;
  text-align: center;
}

.footer-text {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent);
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 80px 20px;
}

.empty-state h2 {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.empty-state p {
  color: var(--text-muted);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.deal-card {
  animation: fadeIn 0.4s ease backwards;
}

.deal-card:nth-child(1) {
  animation-delay: 0.02s;
}

.deal-card:nth-child(2) {
  animation-delay: 0.04s;
}

.deal-card:nth-child(3) {
  animation-delay: 0.06s;
}

.deal-card:nth-child(4) {
  animation-delay: 0.08s;
}

.deal-card:nth-child(5) {
  animation-delay: 0.10s;
}

.deal-card:nth-child(6) {
  animation-delay: 0.12s;
}

.deal-card:nth-child(7) {
  animation-delay: 0.14s;
}

.deal-card:nth-child(8) {
  animation-delay: 0.16s;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}