/* ══════════════════════════════════════════════════════
   main-page.css — ShadowStore main page styles
   ══════════════════════════════════════════════════════ */

/* ── Navbar overrides ────────────────────────────────── */
.nav-login-btn {
  color: rgba(255,255,255,.85) !important;
  border-color: rgba(255,255,255,.3) !important;
  margin-right: 8px;
}
.logout-link { color: var(--accent) !important; }
.cart-btn { position: relative; }

.cart-count {
  position: absolute;
  top: 4px; right: 4px;
  background: var(--accent);
  color: #fff;
  font-size: .6rem;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--nav-bg);
  pointer-events: none;
}

/* ── Hero ────────────────────────────────────────────── */
.hero {
  display: flex;
  align-items: center;
  gap: 48px;
  min-height: 520px;
  padding: 60px 5vw 60px;
  background: linear-gradient(135deg, #111113 0%, #1a1a1f 50%, #0f0f14 100%);
  overflow: hidden;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(230,57,70,.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  flex: 1;
  max-width: 520px;
  z-index: 1;
}

.hero-badge {
  display: inline-block;
  background: rgba(230,57,70,.15);
  border: 1px solid rgba(230,57,70,.35);
  color: var(--accent);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
  margin-bottom: 20px;
}
.hero-title em {
  font-style: normal;
  background: linear-gradient(90deg, var(--accent), #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1rem;
  color: rgba(255,255,255,.6);
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 400px;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn-lg {
  padding: 14px 28px !important;
  font-size: 1rem !important;
}

.hero-outline-btn {
  color: rgba(255,255,255,.85) !important;
  border-color: rgba(255,255,255,.25) !important;
}
.hero-outline-btn:hover {
  background: rgba(255,255,255,.08) !important;
  border-color: rgba(255,255,255,.5) !important;
}

.hero-image {
  flex: 1;
  max-width: 480px;
  position: relative;
  z-index: 1;
}
.hero-image img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: 0 32px 80px rgba(0,0,0,.5);
}

.hero-badge-float {
  position: absolute;
  bottom: -16px;
  left: -16px;
  background: var(--accent);
  border-radius: var(--radius);
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 8px 24px rgba(230,57,70,.4);
}
.badge-float-num {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.badge-float-txt {
  font-size: .7rem;
  color: rgba(255,255,255,.8);
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* ── Category banner ─────────────────────────────────── */
@keyframes catBannerIn {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cat-banner {
  background: linear-gradient(135deg, #13131a 0%, #1b1b24 100%);
  border-bottom: 1px solid var(--border);
  padding: 36px 0 32px;
  position: relative;
  overflow: hidden;
}
.cat-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 100% at 80% 50%, rgba(230,57,70,.09) 0%, transparent 70%);
  pointer-events: none;
}

.cat-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  animation: catBannerIn .35s ease both;
}

.cat-banner-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.cat-banner-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color .2s;
}
.cat-banner-breadcrumb a:hover { color: var(--accent); }

.cat-banner-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 8px;
}

.cat-banner-sub {
  font-size: .875rem;
  color: var(--text-muted);
}

.cat-banner-back {
  color: rgba(255,255,255,.7) !important;
  border-color: rgba(255,255,255,.2) !important;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  flex-shrink: 0;
}
.cat-banner-back:hover {
  background: rgba(255,255,255,.07) !important;
  border-color: rgba(255,255,255,.4) !important;
  color: #fff !important;
}

/* ── Category pills ──────────────────────────────────── */
.cat-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 36px;
  padding-bottom: 8px;
}

.cat-pill {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: .85rem;
  font-weight: 500;
  transition: var(--transition);
  text-decoration: none;
}
.cat-pill:hover, .cat-pill.active-pill {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Featured category cards ─────────────────────────── */
.feat-cats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding-top: 32px;
  padding-bottom: 32px;
}

.feat-cat-card {
  height: 220px;
  border-radius: var(--radius-lg);
  background-size: cover;
  background-position: center;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: transform .3s ease, box-shadow .3s ease;
}
.feat-cat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.feat-cat-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.75) 0%, rgba(0,0,0,.1) 60%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
}

.feat-cat-label {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.feat-cat-link {
  font-size: .8rem;
  color: rgba(255,255,255,.8);
  font-weight: 500;
  text-decoration: none;
  transition: color .2s;
}
.feat-cat-link:hover { color: var(--accent); }

/* ── Products section ────────────────────────────────── */
.products-section {
  padding-bottom: 60px;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.section-sub {
  font-size: .875rem;
  color: var(--text-muted);
}

/* ── Shop layout ─────────────────────────────────────── */
.shop-layout {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar {
  width: 210px;
  flex-shrink: 0;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  display: none;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.sidebar-header h3 {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.sidebar-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: .85rem;
  display: none;
}

.category-list { list-style: none; padding: 10px 0; }

.category-link {
  display: block;
  padding: 9px 20px;
  font-size: .875rem;
  color: var(--text);
  border-left: 3px solid transparent;
  transition: var(--transition);
  text-decoration: none;
}
.category-link:hover {
  background: var(--bg);
  color: var(--accent);
  border-left-color: var(--accent);
}

/* ── Product grid ────────────────────────────────────── */
.shop-main { flex: 1; min-width: 0; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

/* ── Product card ────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.product-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  display: block;
  text-decoration: none;
  color: var(--text);
  animation: fadeInUp .4s ease both;
}

/* stagger each card */
.product-card:nth-child(1)  { animation-delay: .03s; }
.product-card:nth-child(2)  { animation-delay: .07s; }
.product-card:nth-child(3)  { animation-delay: .11s; }
.product-card:nth-child(4)  { animation-delay: .15s; }
.product-card:nth-child(5)  { animation-delay: .19s; }
.product-card:nth-child(6)  { animation-delay: .23s; }
.product-card:nth-child(7)  { animation-delay: .27s; }
.product-card:nth-child(8)  { animation-delay: .31s; }
.product-card:nth-child(9)  { animation-delay: .35s; }
.product-card:nth-child(n+10){ animation-delay: .38s; }

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 56px rgba(0,0,0,.35), 0 0 0 1px rgba(230,57,70,.2);
  border-color: rgba(230,57,70,.35);
}

.product-card-img {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #1a1a1e;
  position: relative;
}
.product-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.25,.46,.45,.94);
}
.product-card:hover .product-card-img img {
  transform: scale(1.09);
}

/* Image overlay on hover */
.product-card-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.55) 0%, transparent 55%);
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.product-card:hover .product-card-img::after {
  opacity: 1;
}

/* "View" label that slides up over image */
.product-card-img .product-card-view {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: rgba(255,255,255,.95);
  color: #0f0f12;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 6px 18px;
  border-radius: 999px;
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
  white-space: nowrap;
  z-index: 2;
}
.product-card:hover .product-card-view {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.product-card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--accent);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .06em;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(230,57,70,.4);
}

.product-card-body { padding: 14px 16px 16px; }

.product-card-cat {
  font-size: .7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 5px;
  font-weight: 600;
}

.product-card-name {
  font-size: .95rem;
  font-weight: 600;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  transition: color .2s;
}
.product-card:hover .product-card-name { color: var(--accent); }

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

.product-card-price {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent);
}

.product-card-cta {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 4px;
}
.product-card:hover .product-card-cta {
  color: var(--accent);
  gap: 7px;
}

/* ── Pagination ──────────────────────────────────────── */
.pagination-wrap { margin-top: 40px; display: flex; justify-content: center; }

/* ── Promo banner ────────────────────────────────────── */
.promo-banner {
  background: linear-gradient(135deg, var(--accent) 0%, #c1121f 100%);
  padding: 56px 5vw;
  margin: 40px 0 0;
}
.promo-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.promo-text h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}
.promo-text h2 span { text-decoration: underline; text-underline-offset: 4px; }
.promo-text p { color: rgba(255,255,255,.8); font-size: 1rem; }
.promo-banner .btn-primary {
  background: #fff !important;
  color: var(--accent) !important;
  border-color: transparent !important;
}
.promo-banner .btn-primary:hover { background: #f0f0f0 !important; }

/* ── Footer ──────────────────────────────────────────── */
.footer {
  background: #0a0a0c;
  border-top: 1px solid var(--border);
  padding-top: 56px;
  margin-top: 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
}

.footer-brand p {
  margin-top: 14px;
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 260px;
}

.footer-col h4 {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.footer-col a {
  display: block;
  font-size: .875rem;
  color: rgba(255,255,255,.55);
  text-decoration: none;
  margin-bottom: 10px;
  transition: color .2s;
}
.footer-col a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  font-size: .8rem;
  color: var(--text-muted);
}

/* ── Responsive ──────────────────────────────────────── */
@media (min-width: 900px) {
  .sidebar { display: block; }
  .sidebar-close { display: none; }
}

@media (max-width: 1100px) {
  .feat-cats { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 899px) {
  .hero { flex-direction: column; min-height: auto; padding: 40px 5vw; }
  .hero-image { max-width: 100%; }
  .hero-image img { height: 280px; }

  .sidebar {
    position: fixed;
    left: 0; top: 60px; bottom: 0;
    z-index: 200;
    border-radius: 0;
    width: 260px;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform .25s ease;
    display: block;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .sidebar-close { display: block; }
}

@media (max-width: 700px) {
  .feat-cats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .feat-cat-card { height: 160px; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .product-card-name { font-size: .85rem; }
  .cat-strip { gap: 6px; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 1.9rem; }
  .promo-content { flex-direction: column; text-align: center; }
}

/* ── Badge color variants ──────────────────────────────── */
.pcb-sale   { background: #e63946; box-shadow: 0 2px 8px rgba(230,57,70,.45); }
.pcb-new    { background: #2d9cdb; box-shadow: 0 2px 8px rgba(45,156,219,.4); }
.pcb-hot    { background: #f4a261; box-shadow: 0 2px 8px rgba(244,162,97,.4); }
.pcb-best   { background: #7b2d8b; box-shadow: 0 2px 8px rgba(123,45,139,.4); }
.pcb-top    { background: #2a9d8f; box-shadow: 0 2px 8px rgba(42,157,143,.4); }

/* ── Top Sales section ─────────────────────────────────── */
.top-sales-section {
  padding: 56px 0 24px;
}
.top-sales-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}
.top-sale-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform .2s ease, box-shadow .2s ease;
}
.top-sale-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,.3);
}
.top-sale-img {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--surface-2);
}
.top-sale-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.top-sale-card:hover .top-sale-img img {
  transform: scale(1.06);
}
.top-sale-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--accent);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .05em;
  z-index: 2;
}
.top-sale-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

@media (max-width: 700px) {
  .top-sales-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

/* ── Rank badge (top-N number) ─────────────────────────── */
.rank-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(30,30,30,.85);
  color: #fff;
  font-size: .75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255,255,255,.2);
  z-index: 2;
  backdrop-filter: blur(4px);
}
/* ── Flash Sale Banner ──────────────────────────────────── */
.flash-sale-banner {
  background: linear-gradient(135deg, #1a0000 0%, #2d0000 50%, #1a0000 100%);
  border-bottom: 1px solid rgba(230,57,70,.3);
  padding: 32px 0;
  position: relative;
  overflow: hidden;
}
.flash-sale-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(230,57,70,.15) 0%, transparent 70%);
  pointer-events: none;
}
.flash-sale-inner { position: relative; z-index: 1; }
.flash-sale-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.flash-icon { font-size: 1.5rem; }
.flash-sale-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
}
.flash-sale-subtitle {
  font-size: .82rem;
  color: rgba(255,255,255,.5);
}
.flash-sale-cards {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(230,57,70,.4) transparent;
}
.flash-card {
  flex: 0 0 200px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(230,57,70,.25);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform .2s, border-color .2s;
}
.flash-card:hover { transform: translateY(-3px); border-color: rgba(230,57,70,.7); }
.flash-card-img { height: 150px; overflow: hidden; }
.flash-card-img img { width: 100%; height: 100%; object-fit: cover; }
.flash-card-body { padding: 12px 14px; }
.flash-card-name { font-size: .82rem; font-weight: 600; color: #fff; margin: 0 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flash-card-prices { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.flash-card-old { font-size: .75rem; color: rgba(255,255,255,.4); text-decoration: line-through; }
.flash-card-new { font-size: 1rem; font-weight: 800; color: #ff6b6b; }
.flash-countdown {
  display: flex;
  align-items: center;
  gap: 4px;
}
.countdown-unit {
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.cd-num {
  font-size: .9rem;
  font-weight: 700;
  color: #fff;
  background: rgba(230,57,70,.3);
  border-radius: 5px;
  padding: 2px 5px;
  min-width: 26px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.cd-label { font-size: .62rem; color: rgba(255,255,255,.5); }
.cd-sep { color: rgba(255,255,255,.4); font-weight: 700; font-size: .85rem; }

.rank-badge-gold {
  background: linear-gradient(135deg, #f4c430, #e09a00);
  color: #1a1a1a;
  border-color: rgba(255,255,255,.35);
}
