:root {
  --bg: #09111f;
  --bg-soft: #111a2f;
  --card: rgba(255, 255, 255, 0.08);
  --card-2: rgba(255, 255, 255, 0.06);
  --card-border: rgba(255, 255, 255, 0.14);
  --text: #f4f7fb;
  --muted: #afbbd2;
  --accent: #7c5cff;
  --accent-2: #1fd1a5;
  --warning: #ffb84d;
  --danger: #ff6b6b;
  --success: #25c281;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --transition: 250ms ease;
  --max-width: 1280px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(124, 92, 255, 0.22), transparent 28%),
    radial-gradient(circle at top right, rgba(31, 209, 165, 0.14), transparent 24%),
    linear-gradient(135deg, #08101d, #10192f 45%, #0c1323);
}

img {
  display: block;
  width: 100%;
}

button,
input,
select {
  font: inherit;
}

button {
  border: none;
  cursor: pointer;
}

.container {
  width: min(var(--max-width), calc(100% - 2rem));
  margin: 0 auto;
}

.hero-card,
.product-card,
.search-wrap,
.sort-select,
.filter-btn,
.cart-btn,
.icon-btn,
.modal-card,
.cart-sidebar,
.summary-box,
.shipping-progress-box,
.toast,
.ghost-chip {
  background: var(--card);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.header-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(7, 12, 22, 0.56);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.brand-text h2 {
  font-size: 1.1rem;
}

.brand-text span {
  color: var(--muted);
  font-size: 0.85rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.icon-btn,
.cart-btn {
  color: var(--text);
  border-radius: 16px;
  padding: 0.85rem 1rem;
  transition: transform var(--transition), background var(--transition);
}

.icon-btn:hover,
.cart-btn:hover {
  transform: translateY(-2px);
}

.cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.badge {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
  font-size: 0.76rem;
  background: linear-gradient(135deg, var(--accent), #9a87ff);
  color: #fff;
}

.hero {
  padding: 2rem 0 1.5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 1rem;
}

.hero-card {
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  overflow: hidden;
  position: relative;
}

.hero-card::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -50px;
  bottom: -60px;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.28), transparent 65%);
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-flex;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  margin-bottom: 1rem;
}

.hero-main h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.05;
  max-width: 11ch;
  margin-bottom: 1rem;
}

.hero-main p {
  color: var(--muted);
  line-height: 1.75;
  max-width: 60ch;
  margin-bottom: 1.2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.cta,
.ghost-chip,
.filter-btn,
.clear-btn,
.remove-btn,
.qty-btn,
.add-btn,
.wishlist-toggle,
.close-btn,
.checkout-btn {
  transition: transform var(--transition), opacity var(--transition), background var(--transition);
}

.cta,
.ghost-chip {
  padding: 0.9rem 1rem;
  border-radius: 16px;
  color: var(--text);
}

.cta {
  background: linear-gradient(135deg, var(--accent), #9078ff);
  font-weight: 700;
}

.ghost-chip {
  background: var(--card-2);
}

.small-chip {
  padding: 0.7rem 0.9rem;
  font-size: 0.9rem;
}

.cta:hover,
.ghost-chip:hover,
.filter-btn:hover,
.add-btn:hover,
.checkout-btn:hover,
.clear-btn:hover {
  transform: translateY(-2px);
}

.hero-side {
  display: grid;
  gap: 1rem;
}

.mini-stat h3 {
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.mini-stat strong {
  display: block;
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.mini-stat span {
  color: var(--muted);
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  margin: 1rem 0;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.95rem 1rem;
  border-radius: 18px;
}

.search-wrap input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
}

.search-wrap input::placeholder {
  color: #94a3bf;
}

.sort-select {
  color: var(--text);
  border-radius: 16px;
  padding: 0.95rem 1rem;
  outline: none;
  min-width: 220px;
}

.sort-select option {
  color: #000;
}

.filters-section {
  margin-bottom: 1.2rem;
}

.filter-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-btn {
  color: var(--text);
  padding: 0.8rem 1rem;
  border-radius: 14px;
}

.filter-btn.active {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.35), rgba(31, 209, 165, 0.15));
  border-color: rgba(255, 255, 255, 0.25);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-head h2 {
  font-size: 1.4rem;
}

.section-head p {
  color: var(--muted);
  margin-top: 0.25rem;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  padding-bottom: 3rem;
}

.product-card {
  border-radius: 22px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), border-color var(--transition);
}

.product-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.22);
}

.product-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 450ms ease;
}

.product-card:hover .product-media img {
  transform: scale(1.08);
}

.category-pill,
.product-badge,
.rating-pill {
  position: absolute;
  border-radius: 999px;
  padding: 0.42rem 0.7rem;
  font-size: 0.75rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(9, 14, 25, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.category-pill {
  top: 12px;
  left: 12px;
}

.product-badge {
  top: 12px;
  right: 12px;
}

.rating-pill {
  left: 12px;
  bottom: 12px;
}

.wishlist-toggle {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(10, 15, 25, 0.72);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.wishlist-toggle.active {
  color: #ff7a96;
}

.product-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  flex: 1;
}

.product-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.product-title {
  font-size: 1.05rem;
  line-height: 1.35;
}

.price-block {
  text-align: right;
}

.price {
  font-size: 1.05rem;
  font-weight: 800;
}

.old-price {
  color: var(--muted);
  text-decoration: line-through;
  font-size: 0.82rem;
}

.product-desc {
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.93rem;
  line-clamp: 2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  margin-top: auto;
}

.add-btn {
  background: linear-gradient(135deg, var(--accent), #8d75ff);
  color: white;
  border-radius: 14px;
  padding: 0.9rem 1rem;
  font-weight: 700;
}

.empty-state {
  grid-column: 1 / -1;
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 18, 0.68);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
}

.modal.show {
  display: flex;
  animation: fadeIn 180ms ease;
}

.modal-card {
  width: min(980px, 100%);
  border-radius: 28px;
  overflow: hidden;
  position: relative;
  animation: popIn 220ms ease;
}

.modal-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  min-height: 520px;
}

.modal-image {
  background: rgba(255, 255, 255, 0.04);
}

.modal-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
}

.modal-static-pill {
  position: static;
}

.modal-content h3 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.1;
}

.modal-content p {
  color: var(--muted);
  line-height: 1.75;
}

.feature-list {
  list-style: none;
  display: grid;
  gap: 0.5rem;
  color: var(--muted);
}

.modal-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(11, 16, 32, 0.65);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 2;
}

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 20, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  z-index: 90;
}

.cart-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.cart-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: min(430px, 100%);
  height: 100vh;
  z-index: 95;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 320ms cubic-bezier(.22, 1, .36, 1);
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.cart-sidebar.show {
  transform: translateX(0);
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 1rem;
}

.shipping-progress-box {
  border-radius: 18px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.shipping-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  font-size: 0.92rem;
}

.progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  transition: width 300ms ease;
}

#shippingMessage {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.clear-btn,
.remove-btn,
.qty-btn {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}

.clear-btn {
  padding: 0.7rem 0.9rem;
}

.cart-items {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding-right: 0.15rem;
}

.cart-item {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 0.9rem;
  padding: 0.8rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.cart-item img {
  width: 82px;
  height: 82px;
  object-fit: cover;
  border-radius: 14px;
}

.cart-item-title {
  font-size: 0.98rem;
  margin-bottom: 0.35rem;
}

.cart-item-price {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 0.65rem;
}

.cart-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.qty-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.qty-btn,
.remove-btn {
  padding: 0.45rem 0.7rem;
}

.qty-value {
  min-width: 22px;
  text-align: center;
}

.summary-box {
  border-radius: 22px;
  padding: 1rem;
  margin-top: 1rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  margin-bottom: 0.8rem;
}

.summary-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.15rem;
  font-weight: 800;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.checkout-btn {
  width: 100%;
  padding: 1rem;
  border-radius: 16px;
  font-weight: 800;
  color: white;
  margin-top: 1rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.empty-cart {
  text-align: center;
  color: var(--muted);
  margin-top: 3rem;
  line-height: 1.7;
}

.toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  min-width: 260px;
  max-width: 340px;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  color: var(--text);
  animation: slideIn 250ms ease;
}

.toast.success {
  border-color: rgba(37, 194, 129, 0.35);
}

.toast.info {
  border-color: rgba(124, 92, 255, 0.35);
}

.toast.warning {
  border-color: rgba(255, 184, 77, 0.35);
}

footer {
  padding: 1.5rem 0 2.5rem;
  color: var(--muted);
  text-align: center;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px) translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0) translateX(0);
  }
}

.bump {
  animation: bump 320ms ease;
}

@media (max-width: 1100px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-grid,
  .modal-grid {
    grid-template-columns: 1fr;
  }

  .modal-image {
    max-height: 380px;
  }
}

@media (max-width: 768px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .filter-row {
    justify-content: flex-start;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .container {
    width: min(100% - 1rem, var(--max-width));
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .product-actions {
    grid-template-columns: 1fr;
  }

  .cart-item {
    grid-template-columns: 1fr;
  }

  .cart-item img {
    width: 100%;
    height: 180px;
  }
}