:root {
  --bg: #0b0b0e;
  --surface: #141419;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --border: #27272a;
  --primary: #ef4444;
  --primary-hover: #dc2626;
  --accent: #ffffff;
  --skeleton-base: #1f1f27;
  --skeleton-highlight: #2e2e38;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(11, 11, 14, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--accent);
  font-weight: 700;
  font-size: 1.2rem;
}

.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.main-nav .nav-list {
  display: flex;
  list-style: none;
  gap: 28px;
}

.nav-link {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.icon-btn:hover {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.45);
}

.cart-badge {
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Main */
.main-content {
  flex: 1;
  padding-top: 32px;
  padding-bottom: 64px;
}

.hero-banner {
  background: linear-gradient(135deg, #09090b 0%, #450a0a 55%, #991b1b 100%);
  border: 1px solid rgba(239, 68, 68, 0.3);
  box-shadow: 0 16px 40px rgba(153, 27, 27, 0.25);
  color: #fff;
  border-radius: 20px;
  padding: 40px 36px;
  margin-bottom: 36px;
  box-shadow: var(--shadow);
}

.hero-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.14);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.hero-banner h1 {
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  margin-bottom: 10px;
  line-height: 1.2;
}

.hero-banner p {
  max-width: 640px;
  color: #cbd5e1;
  font-size: 1rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 12px;
}

.section-header h2 {
  font-size: 1.4rem;
  color: var(--accent);
}

.product-counter {
  font-size: 0.9rem;
  color: var(--muted);
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 22px;
}

/* Product Card */
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.1);
}

/* Fade-in animation for loaded products */
.fade-in {
  opacity: 0;
  transform: translateY(18px);
  animation: fadeInUp 0.55s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-image-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f8fafc;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}

.product-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
}

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

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

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

.add-cart-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.add-cart-btn:hover {
  background: var(--primary-hover);
}

/* Skeleton Loader */
.skeleton-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.skeleton-box {
  background: linear-gradient(
    90deg,
    var(--skeleton-base) 25%,
    var(--skeleton-highlight) 50%,
    var(--skeleton-base) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton-img {
  width: 100%;
  aspect-ratio: 4 / 3;
}

.skeleton-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton-line {
  height: 14px;
  border-radius: 6px;
}

.skeleton-line.title {
  width: 70%;
  height: 18px;
}

.skeleton-line.short {
  width: 45%;
}

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

.skeleton-price {
  width: 64px;
  height: 22px;
  border-radius: 6px;
}

.skeleton-btn {
  width: 90px;
  height: 34px;
  border-radius: 8px;
}

.scroll-sentinel {
  height: 20px;
  margin-top: 24px;
}

.end-message {
  text-align: center;
  color: var(--muted);
  margin-top: 24px;
  font-size: 0.95rem;
}

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 20px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Modals & Drawer */
.hidden {
  display: none !important;
}

.modal,
.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-drawer {
  justify-content: flex-end;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.modal-card {
  position: relative;
  background: var(--surface);
  width: 100%;
  max-width: 400px;
  margin: 20px;
  padding: 28px;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
  z-index: 1;
}

.drawer-panel {
  position: relative;
  background: var(--surface);
  width: 100%;
  max-width: 380px;
  height: 100%;
  padding: 24px;
  display: flex;
  flex-direction: column;
  z-index: 1;
  box-shadow: -10px 0 30px rgba(15, 23, 42, 0.15);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--muted);
  cursor: pointer;
}

.drawer-header .modal-close {
  position: static;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 18px;
}

.login-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 500;
}

.login-form input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.empty-cart {
  color: var(--muted);
  text-align: center;
  margin-top: 40px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.cart-item-info h4 {
  font-size: 0.92rem;
}

.cart-item-info span {
  font-size: 0.85rem;
  color: var(--muted);
}

.remove-item-btn {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}

.drawer-footer {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 1.05rem;
}

@media (max-width: 768px) {
  .main-nav {
    display: none;
  }

  .action-label {
    display: none;
  }

  .hero-banner {
    padding: 28px 22px;
  }
}
