@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg-primary: #0f1419;
  --bg-secondary: #1a1f2e;
  --bg-tertiary: #252d3d;
  --text-primary: #f0f4f8;
  --text-secondary: #b0b8c1;
  --text-muted: #6b7280;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #10b981;
  --border: #2d3748;
  --shadow: 0 4px 12px rgba(0,0,0,0.15);
  --shadow-lg: 0 12px 24px rgba(0,0,0,0.2);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* ========== HEADER ========== */
header {
  background: linear-gradient(135deg, rgba(15,20,25,0.98) 0%, rgba(26,31,46,0.98) 100%);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: var(--space-lg) 0;
  box-shadow: var(--shadow);
}

nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.logo {
  display: flex;
  justify-content: center;
  align-items: center;
  transition: var(--transition);
  margin: 0 auto;
}

.logo img {
  height: 60px !important;
  width: auto !important;
  max-width: 280px !important;
  display: block !important;
  object-fit: contain !important;
  filter: drop-shadow(0 2px 8px rgba(59,130,246,0.4)) !important;
}

.logo:hover img {
  transform: scale(1.05);
  filter: drop-shadow(0 4px 12px rgba(59,130,246,0.6)) !important;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: var(--space-xl);
  align-items: center;
  justify-content: center;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05rem;
  transition: var(--transition);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
}

.nav-links a:hover {
  color: var(--accent);
  background: rgba(59,130,246,0.1);
}

/* Mobile hamburger (hidden on desktop; shown via @media 768) */
.nav-toggle {
  display: none;
  flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  width: 44px; height: 44px; padding: 0;
  background: none; border: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--text-secondary); border-radius: 2px; transition: transform .3s ease, opacity .2s ease; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.hero-trust { font-size: 0.85rem; color: var(--text-secondary); opacity: 0.8; margin: 0.4rem 0 0; }

/* ========== HERO ========== */
.hero {
  background: linear-gradient(135deg, #1a1f2e 0%, #252d3d 50%, #1f2937 100%);
  padding: clamp(3rem, 8vw, 5rem) 0;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 900;
  margin-bottom: var(--space-md);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.highlight {
  color: var(--accent);
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto var(--space-xl) auto;
}

.hero-controls {
  display: flex;
  gap: var(--space-sm);
  max-width: 740px;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;
}

.search-bar {
  flex: 2;
  display: flex;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-width: 300px;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 1rem 1.25rem;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.search-bar input:focus {
  outline: none;
}

.search-btn {
  background: var(--accent);
  border: none;
  padding: 1rem 1.75rem;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.95rem;
}

.search-btn:hover {
  background: var(--accent-hover);
}

.sort-controls {
  flex: 1;
  min-width: 200px;
}

.sort-controls select {
  width: 100%;
  padding: 1rem 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
}

.sort-controls select:hover, 
.sort-controls select:focus {
  border-color: var(--accent);
  outline: none;
}

/* ========== FILTERS ========== */
.filters {
  padding: var(--space-lg) 0;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.filters-title {
  text-align: center;
  margin-bottom: var(--space-md);
  font-size: 1.15rem;
  color: var(--text-primary);
  font-weight: 600;
}

.filter-tags {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  justify-content: center;
}

.filter-tag {
  padding: 0.65rem 1.25rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
  font-size: 0.9rem;
}

.filter-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.filter-tag.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* Buying-guide / category link lists inside #guides (were rendering as bare blue links) */
#guides ul a {
  text-decoration: none;
  color: var(--text-secondary);
  transition: var(--transition);
  font-weight: 500;
}
#guides ul a:hover {
  color: var(--accent);
}

/* "Shop by category" grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-md);
  margin: var(--space-md) 0;
}
.cat-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.1rem 1.2rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text-primary);
  transition: var(--transition);
}
.cat-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.cat-card .cat-emoji { font-size: 1.8rem; }
.cat-card .cat-name { font-weight: 700; }
.cat-card .cat-sub { font-size: 0.82rem; color: var(--text-muted); }

/* ========== PRODUCTS ========== */
.products-section {
  padding: var(--space-2xl) 0;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-lg);
}

.product-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent);
  box-shadow: var(--shadow-lg), 0 0 30px rgba(59,130,246,0.25);
}

.product-image {
  position: relative;
  width: 100%;
  height: 240px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.75rem;
  transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
  transform: scale(1.05);
}

.badge-popular {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, #FF6B6B 0%, #FF5252 100%);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
  z-index: 10;
}

.product-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.product-name {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stars {
  color: #fbbf24;
  font-size: 0.9rem;
}

.rating-value {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.product-description {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.feature-badge {
  font-size: 11px;
  padding: 4px 8px;
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: 4px;
  color: var(--accent);
  font-weight: 500;
}

.product-price {
  margin-top: auto;
  padding-top: 0.5rem;
}

.price-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent);
}

/* Buy Buttons */
.buy-buttons {
  display: grid;
  gap: 10px;
  margin-top: 1rem;
}

.buy-buttons.single-button {
  grid-template-columns: 1fr;
}

.buy-buttons.dual-buttons {
  grid-template-columns: 1fr 1fr;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  text-align: center;
}

.btn-amazon {
  background: linear-gradient(135deg, #FF9900 0%, #FF6600 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(255, 153, 0, 0.3);
}

.btn-amazon:hover {
  background: linear-gradient(135deg, #FF6600 0%, #FF3300 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 153, 0, 0.5);
}

.btn-aliexpress {
  background: linear-gradient(135deg, #E62E04 0%, #C41E3A 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(230, 46, 4, 0.3);
}

.btn-aliexpress:hover {
  background: linear-gradient(135deg, #C41E3A 0%, #A01526 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(230, 46, 4, 0.5);
}

/* ========== NEWSLETTER ========== */
.newsletter {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  padding: var(--space-2xl) 0;
  border-top: 1px solid var(--border);
}

.newsletter-content {
  max-width: 550px;
  margin: 0 auto;
  text-align: center;
}

.newsletter h2 {
  font-size: 2.25rem;
  margin-bottom: var(--space-sm);
  font-weight: 800;
}

.newsletter p {
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  font-size: 1.05rem;
}

.newsletter-form {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
}

.newsletter-form input {
  flex: 1;
  padding: 0.95rem 1.25rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  min-width: 250px;
  font-size: 0.95rem;
  transition: var(--transition);
}

.newsletter-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.btn-primary {
  padding: 0.95rem 1.75rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  font-size: 0.95rem;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}

.newsletter-note {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ========== FOOTER ========== */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: var(--space-2xl) 0 var(--space-lg);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.footer-section h3 {
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  font-size: 1.05rem;
  font-weight: 600;
}

.footer-section p, 
.footer-section ul {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.8;
}

.footer-section ul { 
  list-style: none; 
}

.footer-section li { 
  margin-bottom: 0.5rem; 
}

.footer-section a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
}

.footer-section a:hover { 
  color: var(--accent); 
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: var(--space-lg);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ========== SCROLL TO TOP ========== */
#scrollTopBtn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: linear-gradient(135deg, #1a9dff 0%, #0066cc 100%);
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 20px;
  cursor: pointer;
  display: none;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(26, 157, 255, 0.4);
  transition: all 0.3s ease;
}

#scrollTopBtn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(26, 157, 255, 0.6);
}

.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 1.4rem;
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
}

.scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.scroll-top:hover {
  transform: scale(1.08) translateY(-2px);
  background: var(--accent);
  border-color: var(--accent);
}

.loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.loading-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid rgba(59,130,246,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .container { 
    padding: 0 var(--space-md); 
  }

  .hero-controls { 
    flex-direction: column; 
  }

  .filter-tags { 
    gap: 0.5rem; 
  }

  .filter-tag { 
    font-size: 0.85rem; 
    padding: 0.5rem 1rem; 
  }

  .newsletter-form { 
    flex-direction: column; 
  }

  .products-grid { 
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); 
    gap: var(--space-md); 
  }

  .logo img {
    height: 50px !important;
    max-width: 240px !important;
  }

  header nav.container { position: relative; }
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute; top: calc(100% + 1px); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg-secondary); border-bottom: 1px solid var(--border);
    padding: 0.4rem 1rem 0.9rem; display: none;
    box-shadow: 0 14px 28px rgba(0,0,0,0.35);
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 0.85rem 0.6rem; font-size: 1rem; }

  .hero h1 { 
    font-size: 2.5rem; 
  }

  .buy-buttons.dual-buttons {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero h1 { 
    font-size: 2rem; 
  }

  .products-grid { 
    grid-template-columns: 1fr; 
  }

  .nav-links { 
    gap: var(--space-sm); 
    font-size: 0.85rem; 
    flex-wrap: wrap; 
  }

  .scroll-top, 
  #scrollTopBtn { 
    bottom: 20px; 
    right: 20px; 
    width: 50px; 
    height: 50px; 
  }

  .logo img {
    height: 45px !important;
    max-width: 200px !important;
  }

  .product-image {
    height: 200px;
  }
}

/* Ultrawide: keep content readable, fill the grid, cap hero text */
@media (min-width: 1600px) {
  .container { max-width: 1440px; }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .hero h1 { font-size: 4rem; }
}