/* ═══════════════════════════════════════════
   NEXMENT — store.css
   Store hero, controls, filters, product grid,
   cards, skeletons, empty state, load more
═══════════════════════════════════════════ */

/* ── KEYFRAMES ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes cardReveal {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124,58,237,0.5); }
  50%       { box-shadow: 0 0 0 7px rgba(124,58,237,0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ══════════════════════════════════════════
   STORE HERO
══════════════════════════════════════════ */
.store-hero {
  position: relative;
  padding: calc(var(--nav-h) + 44px) 24px 48px;
  overflow: hidden;
  background: var(--bg);
  text-align: center;
}
.store-hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  pointer-events: none;
  z-index: 0;
}
.store-hero-orb-1 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(124,58,237,0.12) 0%, transparent 70%);
  top: -100px; right: -120px;
}
.store-hero-orb-2 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(168,85,247,0.09) 0%, transparent 70%);
  bottom: -60px; left: -80px;
}
.store-hero-grid {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(124,58,237,0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  z-index: 0; pointer-events: none;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, #000 40%, transparent 100%);
}
.store-hero-content {
  position: relative; z-index: 1;
  max-width: 600px; margin: 0 auto;
}
.store-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  background: var(--accent-pale);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 16px;
  animation: fadeUp 0.5s ease both;
}
.badge-pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease infinite;
  flex-shrink: 0;
}
.store-hero-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 5.5vw, 48px);
  font-weight: 800;
  line-height: 1.13;
  letter-spacing: -1.2px;
  color: var(--text-primary);
  margin-bottom: 10px;
  animation: fadeUp 0.54s 0.07s ease both;
}
.store-hero-highlight {
  background: linear-gradient(135deg, var(--accent) 10%, var(--accent-light) 90%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.store-hero-desc {
  font-size: clamp(14px, 2vw, 15.5px);
  color: var(--text-secondary);
  animation: fadeUp 0.58s 0.13s ease both;
}

/* ══════════════════════════════════════════
   STORE MAIN
══════════════════════════════════════════ */
.store-main {
  background: var(--bg);
  padding: 12px 0 72px;
}
.store-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── CONTROLS ROW ── */
.store-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  position: relative;
}

/* Search */
.store-search-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-pill);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-sm);
}
.store-search-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow-sm);
}
.store-search-icon {
  position: absolute; left: 16px;
  color: var(--text-muted); font-size: 13px; pointer-events: none; z-index: 1;
}
.store-search-input {
  flex: 1;
  border: none; outline: none; background: transparent;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  padding: 12px 40px 12px 42px;
  min-width: 0;
}
.store-search-input::placeholder { color: var(--text-muted); }
.store-search-input::-webkit-search-cancel-button { display: none; }
.search-clear {
  position: absolute; right: 12px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-alt); border: none;
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.search-clear:hover { background: var(--accent-pale); color: var(--accent); }

/* Sort */
.store-sort-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 0 16px 0 14px;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  min-width: 185px;
  transition: border-color 0.2s;
}
.store-sort-wrap:focus-within { border-color: var(--accent); }
.sort-icon { color: var(--text-muted); font-size: 13px; flex-shrink: 0; }
.sort-chevron {
  color: var(--text-muted); font-size: 10px; flex-shrink: 0; pointer-events: none;
}
#sortSelect {
  flex: 1;
  border: none; outline: none; background: transparent;
  font-family: var(--font-body);
  font-size: 13.5px; font-weight: 500;
  color: var(--text-primary);
  padding: 12px 0;
  cursor: pointer;
  -webkit-appearance: none; appearance: none;
}

/* ── SEARCH SUGGESTIONS ── */
.search-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
  max-height: 320px;
  overflow-y: auto;
  animation: fadeUp 0.18s ease both;
}
.suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 13.5px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover,
.suggestion-item.focused { background: var(--accent-pale); }
.suggestion-thumb {
  width: 36px; height: 36px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-alt);
  flex-shrink: 0;
}
.suggestion-thumb-placeholder {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--accent-pale);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent-border); font-size: 14px; flex-shrink: 0;
}
.suggestion-info { flex: 1; min-width: 0; }
.suggestion-name {
  font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.suggestion-name mark {
  background: var(--accent-pale);
  color: var(--accent);
  border-radius: 2px;
  font-weight: 700;
}
.suggestion-price {
  font-size: 12px; color: var(--text-muted); margin-top: 1px;
}
.suggestion-no-results {
  padding: 16px;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-muted);
}

/* ── FILTERS ── */
.store-filters-wrap {
  position: relative;
  margin-bottom: 14px;
}
.store-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  white-space: nowrap;
  position: relative;
}
.filter-chip:hover {
  border-color: var(--accent-border);
  color: var(--accent);
  background: var(--accent-pale);
  transform: translateY(-1px);
}
.filter-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 4px 14px var(--accent-glow);
}
.filter-chip i { font-size: 11px; }

/* Bundle chip special style */
.filter-chip--bundle {
  background: linear-gradient(135deg, #f5f3ff, #ede9fe);
  border-color: var(--accent-border);
  color: var(--accent);
}
.filter-chip--bundle:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.filter-chip--bundle.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-mid));
  box-shadow: 0 4px 20px var(--accent-glow);
}
.bundle-badge {
  min-width: 18px; height: 18px;
  background: var(--accent-mid);
  color: #fff;
  font-size: 10px; font-weight: 700;
  border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 4px;
  margin-left: 2px;
}
.filter-chip.active .bundle-badge { background: rgba(255,255,255,0.25); }

/* ── ACTIVE FILTERS ROW ── */
.active-filters-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: var(--accent-pale);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  animation: fadeUp 0.2s ease both;
}
.active-filter-label {
  font-size: 12px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.active-filter-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  background: var(--surface);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600;
  color: var(--accent);
}
.active-filter-tag button {
  display: flex; align-items: center; justify-content: center;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 10px;
  transition: color 0.2s;
}
.active-filter-tag button:hover { color: var(--error); }
.clear-all-filters {
  margin-left: auto;
  font-size: 12px; font-weight: 600;
  color: var(--accent); background: none; border: none;
  cursor: pointer; transition: opacity 0.2s;
  text-decoration: underline;
}
.clear-all-filters:hover { opacity: 0.7; }

/* ── META ROW ── */
.store-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.results-meta {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}
.view-toggle {
  display: flex;
  gap: 4px;
}
.view-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.view-btn.active,
.view-btn:hover {
  background: var(--accent-pale);
  color: var(--accent);
  border-color: var(--accent-border);
}

/* ══════════════════════════════════════════
   SKELETON
══════════════════════════════════════════ */
.product-skeleton {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: linear-gradient(
    90deg,
    var(--bg-alt) 25%,
    var(--surface-2) 50%,
    var(--bg-alt) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  height: 320px;
}

/* ══════════════════════════════════════════
   PRODUCTS GRID
══════════════════════════════════════════ */
.products-grid {
  display: grid;
  gap: 18px;
}
.products-grid[data-view="grid"] {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.products-grid[data-view="list"] {
  grid-template-columns: 1fr;
  gap: 12px;
}

/* ══════════════════════════════════════════
   PRODUCT CARD — GRID VIEW
══════════════════════════════════════════ */
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: pointer;
  transition: transform 0.24s cubic-bezier(0.4,0,0.2,1),
              box-shadow 0.24s cubic-bezier(0.4,0,0.2,1),
              border-color 0.2s;
  animation: cardReveal 0.4s cubic-bezier(0.4,0,0.2,1) both;
  animation-delay: calc(var(--card-index, 0) * 40ms);
  will-change: transform;
}
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-border);
}

/* Badge strip */
.badge-wrap {
  position: absolute;
  top: 10px; left: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 2;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  backdrop-filter: blur(8px);
  width: fit-content;
}
.badge-bestseller {
  background: rgba(234,179,8,0.92);
  color: #1a1200;
}
.badge-nexment {
  background: rgba(124,58,237,0.92);
  color: #fff;
}
.badge-sale {
  background: rgba(239,68,68,0.9);
  color: #fff;
}
.badge-new {
  background: rgba(34,197,94,0.9);
  color: #fff;
}
.badge-bundle {
  background: linear-gradient(90deg, rgba(124,58,237,0.9), rgba(147,51,234,0.9));
  color: #fff;
}

/* Thumbnail */
.product-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  background: var(--bg-alt);
  overflow: hidden;
}
.product-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.38s cubic-bezier(0.4,0,0.2,1);
}
.product-card:hover .product-img { transform: scale(1.05); }
.product-img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent-pale), var(--bg-alt));
  color: var(--accent-border);
  font-size: 36px;
}

/* Quick-view overlay */
.product-overlay {
  position: absolute; inset: 0;
  background: rgba(26,18,48,0.42);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 0.24s;
}
.product-card:hover .product-overlay { opacity: 1; }
.product-overlay-btn {
  padding: 8px 20px;
  background: #fff;
  color: var(--accent);
  border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 700;
  border: none; cursor: pointer;
  transform: translateY(6px);
  transition: transform 0.24s;
}
.product-card:hover .product-overlay-btn { transform: translateY(0); }

/* Body */
.product-body {
  padding: 14px 14px 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.product-category-tag {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.product-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-desc-snippet {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Footer */
.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 14px;
  margin-top: auto;
  gap: 8px;
}
.product-price-wrap { display: flex; align-items: baseline; gap: 5px; }
.product-price {
  font-size: 17px;
  font-weight: 800;
  color: var(--accent);
}
.product-price-original {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: line-through;
}
.buyers-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-alt);
  border-radius: var(--radius-pill);
  padding: 3px 8px;
}
.buyers-pill i { font-size: 10px; color: var(--accent-light); }

.buy-btn {
  display: block;
  margin: 0 14px 14px;
  padding: 10px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  border: none;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.buy-btn:hover {
  background: var(--accent-mid);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--accent-glow);
}

/* ══════════════════════════════════════════
   PRODUCT CARD — LIST VIEW
══════════════════════════════════════════ */
.products-grid[data-view="list"] .product-card {
  flex-direction: row;
  height: 110px;
  align-items: center;
}
.products-grid[data-view="list"] .product-img-wrap {
  width: 140px;
  height: 100%;
  aspect-ratio: unset;
  flex-shrink: 0;
  border-radius: 0;
}
.products-grid[data-view="list"] .product-body {
  flex: 1;
  padding: 14px 12px;
  gap: 3px;
  justify-content: center;
}
.products-grid[data-view="list"] .product-footer {
  flex-direction: column;
  align-items: flex-end;
  padding: 10px 14px;
  border-top: none;
  gap: 6px;
  flex-shrink: 0;
}
.products-grid[data-view="list"] .buy-btn {
  margin: 0;
  padding: 8px 16px;
  white-space: nowrap;
  font-size: 13px;
}
.products-grid[data-view="list"] .badge-wrap {
  top: 8px; left: 8px;
}
.products-grid[data-view="list"] .product-overlay { display: none; }

/* ══════════════════════════════════════════
   BUNDLE CARD VARIANT
══════════════════════════════════════════ */
.product-card.bundle-card {
  border-color: var(--accent-border);
  background: linear-gradient(160deg, var(--surface) 70%, var(--accent-pale) 100%);
}
.product-card.bundle-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 36px var(--accent-glow);
}

/* ══════════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════════ */
.no-products {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 72px 20px;
  text-align: center;
}
.no-products-icon {
  width: 72px; height: 72px;
  background: var(--accent-pale);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: var(--accent-border);
  margin-bottom: 4px;
}
.no-products h3 {
  font-size: 18px; font-weight: 800;
  color: var(--text-primary);
}
.no-products p {
  font-size: 14px;
  color: var(--text-muted);
}
.btn-reset-filters {
  margin-top: 4px;
  padding: 10px 24px;
  background: var(--accent);
  color: #fff;
  border: none; border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.btn-reset-filters:hover {
  background: var(--accent-mid);
  transform: translateY(-1px);
}

/* ══════════════════════════════════════════
   LOAD MORE
══════════════════════════════════════════ */
.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 36px;
}
.load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 32px;
  background: var(--surface);
  border: 1.5px solid var(--accent-border);
  border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}
.load-more-btn:hover {
  background: var(--accent-pale);
  box-shadow: 0 4px 18px var(--accent-glow);
  transform: translateY(-2px);
}
.load-more-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
#loadMoreSpinner { animation: spin 0.8s linear infinite; }

.no-more-label {
  text-align: center;
  margin-top: 36px;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.no-more-label i { color: var(--accent-light); }

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 860px) {
  .store-hero { padding: calc(var(--nav-h) + 32px) 16px 40px; }
  .store-main { padding: 8px 0 56px; }
  .store-inner { padding: 0 14px; }

  .products-grid[data-view="grid"] {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
  }
}

@media (max-width: 640px) {
  .store-controls { flex-direction: column; gap: 10px; }
  .store-sort-wrap { min-width: unset; width: 100%; border-radius: var(--radius-sm); }
  .store-search-wrap { border-radius: var(--radius-sm); }

  .products-grid[data-view="grid"] {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .products-grid[data-view="list"] .product-img-wrap { width: 100px; }
  .products-grid[data-view="list"] .product-card { height: 100px; }

  .store-meta-row { gap: 10px; }
}

@media (max-width: 400px) {
  .products-grid[data-view="grid"] { grid-template-columns: 1fr; }
  .products-grid[data-view="list"] .product-card {
    flex-direction: column;
    height: auto;
  }
  .products-grid[data-view="list"] .product-img-wrap {
    width: 100%; height: 160px;
  }
  .products-grid[data-view="list"] .product-footer {
    flex-direction: row; align-items: center; width: 100%;
  }
}