/*
 * Home page "marketplace" sections: hub (categories + promo + account
 * panel), ranking boxes, discovery, and the trust/payment strip.
 * Uses the tokens from site.css.
 */

/* ============ HUB ============ */
.hub { width: 100%; justify-self: stretch; padding: 28px 20px 8px; background: #f4f7fb; }
.hub-grid {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 270px;
  gap: 18px;
  align-items: stretch;
}

.hub-cats {
  display: flex;
  flex-direction: column;
  padding: 16px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}
.hub-cats h2 { display: flex; align-items: center; gap: 8px; margin: 0 8px 10px; color: var(--ink); font-size: 15px; font-weight: 800; }
.hub-cats h2 .icon { color: var(--blue); }
.hub-cats ul { flex: 1; margin: 0; padding: 0; list-style: none; }
.hub-cats li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 10px;
  color: #2c3447;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
}
.hub-cats li a:hover,
.hub-cats li a[aria-current="true"] { background: #f1f6ff; color: var(--blue); }
.hub-cat-icon { display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; border-radius: 9px; background: #e8f1ff; color: var(--blue); }
.hub-cat-icon .icon { width: 16px; height: 16px; }
.hub-cat-name { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hub-cat-count { color: var(--muted); font-size: 11px; font-weight: 700; }
.hub-cats-all { display: inline-flex; align-items: center; gap: 4px; margin: 8px 8px 0; color: var(--blue); font-size: 13px; font-weight: 700; text-decoration: none; }

/* Promo carousel */
.promo {
  position: relative;
  min-height: 330px;
  border-radius: 18px;
  overflow: hidden;
  isolation: isolate;
}
.promo-track { position: absolute; inset: 0; }
.promo-slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  padding: 34px 40px 52px;
  color: #dbe6ff;
  opacity: 0;
  visibility: hidden;
  transform: translateX(24px);
  transition: opacity .55s ease, transform .55s ease, visibility .55s;
}
.promo-slide.is-active { opacity: 1; visibility: visible; transform: none; }
.promo-blue { background: radial-gradient(circle at 85% 25%, rgba(18, 207, 255, .45), transparent 45%), linear-gradient(125deg, #04163f, #0a3fae 55%, #0a7dff); }
.promo-green { background: radial-gradient(circle at 85% 25%, rgba(120, 255, 190, .35), transparent 45%), linear-gradient(125deg, #032b22, #0b6b4b 55%, #18a96d); }
.promo-purple { background: radial-gradient(circle at 85% 25%, rgba(255, 160, 230, .35), transparent 45%), linear-gradient(125deg, #1c0b45, #4b25b0 55%, #8d4bff); }
.promo-copy { display: grid; justify-items: start; gap: 12px; }
.promo-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.promo-copy h2 { margin: 0; color: #fff; font-size: clamp(22px, 2.3vw, 32px); font-weight: 800; line-height: 1.15; letter-spacing: -.015em; }
.promo-copy p { margin: 0; max-width: 460px; font-size: 15px; line-height: 1.55; }
.promo-copy .btn-primary { margin-top: 6px; }
.promo-art { position: relative; height: 220px; }
.promo-bubble {
  position: absolute;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 28px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  backdrop-filter: blur(8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, .18);
}
.promo-bubble .icon { width: 46%; height: 46%; stroke-width: 1.6; }
.pb-1 { top: 6%; left: 18%; width: 120px; height: 120px; animation: promo-float 6s ease-in-out infinite; }
.pb-2 { top: 50%; left: 52%; width: 92px; height: 92px; animation: promo-float 7s ease-in-out infinite reverse; }
.pb-3 { top: 58%; left: 4%; width: 74px; height: 74px; animation: promo-float 5s ease-in-out infinite; }
@keyframes promo-float { 50% { transform: translateY(-10px); } }

.promo-nav {
  position: absolute;
  z-index: 2;
  top: 50%;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  cursor: pointer;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity .2s ease, background .2s ease;
}
.promo:hover .promo-nav,
.promo-nav:focus-visible { opacity: 1; }
.promo-nav:hover { background: rgba(255, 255, 255, .32); }
.promo-prev { left: 12px; }
.promo-prev .icon { transform: rotate(180deg); }
.promo-next { right: 12px; }
.promo-dots { position: absolute; z-index: 2; bottom: 18px; left: 40px; display: flex; gap: 8px; }
.promo-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .45); cursor: pointer; transition: width .3s ease, background .3s ease; }
.promo-dots button[aria-selected="true"] { width: 26px; background: #fff; }

/* Account panel */
.hub-user {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #f2f7ff, #fff 40%);
}
.hub-user-head { display: flex; align-items: center; gap: 12px; }
.hub-user-head > div { display: grid; min-width: 0; }
.hub-user-head strong { overflow: hidden; color: var(--ink); font-size: 16px; white-space: nowrap; text-overflow: ellipsis; }
.hub-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  color: #fff;
  font-size: 20px;
  font-weight: 800;
}
.hub-avatar-guest { background: #e1ebfb; color: var(--navy); }
.hub-avatar-guest .icon { width: 24px; height: 24px; }
.hub-user-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hub-user-actions a { justify-content: center; padding: 10px 12px; }
.hub-perks { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; color: #3b4357; font-size: 13px; }
.hub-perks li { display: flex; align-items: center; gap: 8px; }
.hub-perks .icon { color: #1a9b54; stroke-width: 3; }
.hub-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hub-quick a {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 12px 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: #2c3447;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.hub-quick a:hover { border-color: var(--blue); color: var(--blue); }
.hub-quick .icon { width: 20px; height: 20px; color: var(--blue); }
.hub-quick b {
  position: absolute;
  top: 6px;
  right: 8px;
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--heart);
  color: #fff;
  font-size: 10px;
  text-align: center;
}
.hub-quick b.is-muted { background: #e8f1ff; color: var(--blue); }
.hub-quick b[hidden] { display: none; }
.hub-user-cta { justify-content: center; }
.hub-sell {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 12px;
  border-radius: 12px;
  background: #fff7e8;
  color: #6b4b00;
  text-decoration: none;
}
.hub-sell > span { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; border-radius: 10px; background: #ffe7b8; }
.hub-sell div { display: grid; font-size: 12px; }
.hub-sell strong { font-size: 13px; }
.hub-sell:hover { box-shadow: inset 0 0 0 1px #f4d08a; }

/* ============ RANKING BOXES ============ */
.rails-section { padding-top: 8px; background: #f4f7fb; }
.rails-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.rail-box { padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.rail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.rail-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--ink); font-size: 18px; font-weight: 800; }
.rail-head h2 .icon { color: var(--heart); }
.rail-box:last-child .rail-head h2 .icon { color: var(--star); fill: currentColor; }
.rail-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.rail-head .text-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; white-space: nowrap; }
.rail-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; padding: 0; list-style: none; }
.rail-item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; color: var(--ink); text-decoration: none; }
.rail-item:hover { background: #f4f7fb; }
.rail-img { position: relative; display: grid; place-items: center; flex: 0 0 72px; width: 72px; height: 72px; border-radius: 12px; background: #eef2f8; color: #8a93a6; overflow: hidden; }
.rail-img img { width: 100%; height: 100%; object-fit: cover; }
.rail-rank,
.rail-new { position: absolute; top: 4px; left: 4px; padding: 1px 7px; border-radius: 7px; color: #fff; font-size: 11px; font-weight: 800; }
.rail-rank { background: #8a93a6; }
.rail-rank.rank-1 { background: linear-gradient(135deg, #f7b500, #e08a00); }
.rail-rank.rank-2 { background: linear-gradient(135deg, #a8b3c4, #7d889a); }
.rail-rank.rank-3 { background: linear-gradient(135deg, #d8915a, #b06a35); }
.rail-new { background: linear-gradient(135deg, #12b886, #0a8f66); font-size: 10px; letter-spacing: .04em; }
.rail-info { display: grid; gap: 2px; min-width: 0; }
.rail-info strong { overflow: hidden; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
.rail-seller { overflow: hidden; color: var(--muted); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.rail-price { color: var(--ink); font-size: 15px; font-weight: 800; }
.rail-price small { color: var(--muted); font-size: 10px; font-weight: 600; }

/* ============ DISCOVER ============ */
.discover-section { padding-top: 0; }
.discover-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; }
.discover-box { padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.discover-box h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; color: var(--ink); font-size: 18px; font-weight: 800; }
.discover-box h2 .icon { color: var(--blue); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid #dfe8f7;
  border-radius: 999px;
  background: #f7faff;
  color: #2c3447;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.tag-cloud a span { color: var(--muted); font-size: 11px; }
.tag-cloud a:hover { border-color: var(--blue); color: var(--blue); }
.location-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 0; list-style: none; }
.location-list a { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid #edf0f5; border-radius: 12px; color: var(--ink); text-decoration: none; }
.location-list a:hover { border-color: #b9d2ff; background: #f7faff; }
.location-list a > span:nth-child(2) { flex: 1; display: grid; min-width: 0; }
.location-list strong { overflow: hidden; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
.location-list a > span:nth-child(2) span { color: var(--muted); font-size: 12px; }
.location-pin { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; background: #ffecec; color: #d23a3a; }
.location-pin .icon { width: 16px; height: 16px; }
.location-count { color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; }

/* ============ TRUST & PAYMENTS ============ */
.trust-strip { width: 100%; justify-self: stretch; padding: 34px 20px 28px; border-top: 1px solid var(--line); background: #fff; }
.trust-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.trust-item { display: flex; align-items: center; gap: 12px; }
.trust-item div { display: grid; gap: 2px; }
.trust-item strong { color: var(--ink); font-size: 14px; }
.trust-item span { color: var(--muted); font-size: 13px; }
.trust-icon { display: grid; place-items: center; flex: 0 0 46px; width: 46px; height: 46px; border-radius: 14px; background: #e6f6ec; color: #1a7f45; }
.trust-icon .icon { width: 22px; height: 22px; }
.pay-methods { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 24px; padding-top: 20px; border-top: 1px dashed var(--line); }
.pay-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
}
.pb-visa { color: #1a1f71; font-style: italic; }
.pb-mc { color: #eb5a1c; }
.pb-amex { color: #fff; border-color: #1f72cd; background: #1f72cd; }
.pb-stripe { color: #635bff; border-color: #d8d6ff; background: #f6f5ff; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1180px) {
  .hub-grid { grid-template-columns: 220px minmax(0, 1fr); }
  .hub-user { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; }
  .hub-user .hub-perks,
  .hub-user .hub-quick { grid-column: span 1; }
  .hub-sell { margin-top: 0; }
  .rail-list { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .hub-grid,
  .rails-grid,
  .discover-grid,
  .trust-grid { grid-template-columns: 1fr; }
  .hub-cats { display: none; }
  .hub-user { grid-template-columns: 1fr; }
  .promo-slide { grid-template-columns: 1fr; padding: 28px 24px 52px; }
  .promo-art { display: none; }
  .promo-dots { left: 24px; }
  .trust-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .location-list,
  .trust-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .promo-slide,
  .promo-bubble { transition: none; animation: none; }
}
