/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent: #88E788;
  --accent-dark: #5fd15f;
  --bg: #ffffff;
  --bg-card: #f9f9f9;
  --text: #1a1a1a;
  --text-muted: #666;
  --border: #e0e0e0;
  --danger: #e74c3c;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --nav-height: 60px;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

img { display: block; max-width: 100%; }

/* ── NAVBAR ── */
#navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

#nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  text-decoration: none;
}

#nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
  flex-wrap: wrap;
}

#nav-links a {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}

#nav-links a:hover { background: var(--bg-card); color: var(--text); }

#nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Search */
#nav-search-wrap {
  position: relative;
}

#nav-search {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.88rem;
  width: 200px;
  outline: none;
  background: var(--bg-card);
  transition: border-color 0.2s, width 0.2s;
}

#nav-search:focus { border-color: var(--accent); width: 260px; }

.active-filter {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
}

/* Variant chips */
.variant-group { margin-bottom: 14px; }
.variant-group-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.variant-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.variant-chip {
  padding: 6px 16px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 0.88rem;
  cursor: pointer;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  user-select: none;
}
.variant-chip:hover { border-color: var(--accent); color: var(--accent); }
.variant-chip.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* Hamburger */
#nav-hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text);
  padding: 4px 8px;
  border-radius: 6px;
  flex-shrink: 0;
  line-height: 1;
}
#nav-hamburger:hover { background: var(--bg-card); }

/* Nav drawer */
#nav-drawer {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0; right: 0;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  z-index: 99;
  padding: 12px 20px 20px;
  flex-direction: column;
  gap: 2px;
}
#nav-drawer.open { display: flex; }
#drawer-links { display: flex; flex-direction: column; margin-bottom: 4px; }
#drawer-links a {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
#drawer-links a:hover { background: var(--bg-card); color: var(--text); }
.drawer-link {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.drawer-link:hover { background: var(--bg-card); color: var(--text); }
html, body { overflow-x: hidden; }

#search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 320px;
  overflow-y: auto;
  display: none;
  z-index: 200;
  min-width: 280px;
}

#search-results.open { display: block; }

.search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
}

.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--bg-card); }

.search-item img {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--border);
}

.search-item-info { flex: 1; min-width: 0; }
.search-item-name { font-size: 0.88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-item-price { font-size: 0.8rem; color: var(--text-muted); }

/* Currency converter */
#currency-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

#currency-select {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 0.82rem;
  background: var(--bg-card);
  cursor: pointer;
  outline: none;
}

/* ── HERO ── */
#hero {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
  overflow: hidden;
  background: linear-gradient(135deg, #f0fff0 0%, #e8f5e9 100%);
}

#hero-bg {
  position: absolute;
  inset: 0;
  object-fit: cover;
  width: 100%;
  height: 100%;
  opacity: 0.35;
}

#hero-content {
  position: relative;
  z-index: 1;
  max-width: 640px;
}

#hero-title {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 14px;
  color: var(--text);
}

#hero-sub {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-muted);
  margin-bottom: 28px;
}

.btn-hero {
  display: inline-block;
  background: var(--accent);
  color: #000;
  font-weight: 700;
  padding: 13px 32px;
  border-radius: 30px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  border: none;
  text-decoration: none;
}

.btn-hero:hover { background: var(--accent-dark); transform: translateY(-1px); }

.btn-floating-buy {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #000;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: 30px;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  transition: background 0.2s, transform 0.15s;
}

.btn-floating-buy:hover { background: var(--accent-dark); transform: translateY(-2px); }

@media (max-width: 600px) {
  .btn-floating-buy {
    bottom: 16px;
    right: 16px;
    left: 16px;
    width: calc(100% - 32px);
    justify-content: center;
    padding: 14px 0;
  }
}

/* ── TRUST BADGES ── */
#trust-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 28px;
  padding: 28px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.trust-badge .icon { font-size: 1.3rem; }

/* ── MAIN CONTENT ── */
#main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

/* ── CATEGORY FILTERS ── */
#category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.cat-btn {
  padding: 7px 18px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-muted);
}

.cat-btn:hover { border-color: var(--accent); color: var(--text); }
.cat-btn.active { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 600; }

/* ── PRODUCT GRID ── */
#product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.product-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.18s, box-shadow 0.18s;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
}

.product-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }

.product-card-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--bg-card);
}

.product-card-img-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--border);
}

.product-card-body {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product-card-name {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
}

.product-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  flex: 1;
}

.product-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.product-card-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.stars {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 0.78rem;
  color: #f39c12;
}

.stars .count { color: var(--text-muted); margin-left: 3px; }

/* ── INFINITE SCROLL SENTINEL ── */
#scroll-sentinel {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ── EMPTY / ERROR STATES ── */
.state-msg {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  grid-column: 1 / -1;
}

.state-msg .icon { font-size: 2.5rem; margin-bottom: 12px; }

/* ── SKELETON CARD ── */
.skeleton-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.skeleton-img {
  width: 100%;
  aspect-ratio: 1;
  background: #f0f0f0;
  position: relative;
  overflow: hidden;
}

.skeleton-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.skeleton-line { height: 12px; border-radius: 4px; background: #f0f0f0; position: relative; overflow: hidden; }
.skeleton-line.short { width: 55%; }

.skeleton-img::after, .skeleton-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer { 100% { transform: translateX(100%); } }

/* ── FOOTER ── */
#footer {
  text-align: center;
  padding: 24px;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  #navbar {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 14px 8px;
    gap: 0;
    row-gap: 8px;
  }
  #nav-logo {
    flex: 1;
  }
  #nav-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
  }
  #nav-links { display: none !important; }
  .nav-standalone-link { display: none !important; }
  #nav-right {
    order: 10;
    width: 100%;
    padding: 0;
  }
  #nav-search-wrap {
    width: 100%;
  }
  #nav-search {
    width: 100% !important;
    box-sizing: border-box;
    border-radius: 10px;
    padding: 9px 16px;
    font-size: 0.92rem;
  }
  #nav-search:focus {
    width: 100% !important;
  }
  #search-results {
    border-radius: 10px;
  }
  #nav-drawer {
    border-radius: 0 0 14px 14px;
    padding: 8px 14px 16px;
  }
  #drawer-links a {
    padding: 12px 10px;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border);
  }
  #drawer-links a:last-child {
    border-bottom: none;
  }
  .drawer-link {
    padding: 12px 10px;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border);
    display: block;
    border-radius: 0;
  }
  .drawer-link:last-child {
    border-bottom: none;
  }
}
@media (max-width: 600px) {
  #navbar { padding: 10px 12px 8px; }
  #nav-search { width: 140px; }
  #nav-search:focus { width: 180px; }
  #product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .product-card-body { padding: 8px; gap: 4px; }
  .product-card-name { font-size: 0.78rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .product-card-desc { font-size: 0.70rem; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
  #hero { min-height: 300px; padding: 40px 16px; }
}
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-bottom: 10px;
}

.footer-legal a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
}

.footer-legal a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.footer-copy {
  text-align: center;
}

.btn-load-more {
  display: block;
  margin: 20px auto 0;
  padding: 10px 28px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  transition: all 0.15s;
}
.btn-load-more:hover { border-color: var(--accent); color: var(--accent); }
.btn-load-more:disabled { opacity: 0.6; cursor: default; }
