/* ============================================================
   NEXUS COMMERCE — Modern Glassmorphism & High-End Design System
   ============================================================ */

:root {
  --bg-primary: #0a0d14;
  --bg-secondary: #0f1422;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(26, 35, 56, 0.85);
  --bg-glass: rgba(15, 20, 34, 0.65);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.35);

  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: rgba(99, 102, 241, 0.15);
  --accent-glow: 0 0 25px rgba(99, 102, 241, 0.45);
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  --badge-gradient: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #0ea5e9;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.6);
  --backdrop: blur(16px);
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.10) 0px, transparent 50%);
  background-attachment: fixed;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

/* ============================================================
   TOP BAR
   ============================================================ */
.topbar {
  background: rgba(10, 13, 20, 0.9);
  border-bottom: 1px solid var(--border-color);
  font-size: 12.5px;
  color: var(--text-secondary);
  padding: 8px 0;
  backdrop-filter: var(--backdrop);
}

.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar-highlight {
  color: #a855f7;
  font-weight: 600;
}

.topbar-links {
  display: flex;
  gap: 18px;
  align-items: center;
}

.topbar-links a:hover {
  color: var(--text-primary);
}

/* ============================================================
   HEADER & NAVBAR
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-glass);
  backdrop-filter: var(--backdrop);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.header-main {
  padding: 16px 0;
}

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

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: var(--accent-glow);
}

.brand-title span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-search {
  flex: 1;
  max-width: 520px;
  position: relative;
}

.search-form {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 4px 6px 4px 18px;
  transition: var(--transition);
}

.search-form:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.search-btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.5);
}

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

.action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.6);
}

/* Subnav */
.header-nav {
  display: flex;
  gap: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 10px 0;
  font-size: 14px;
  font-weight: 500;
}

.nav-link {
  color: var(--text-secondary);
  position: relative;
  padding: 4px 0;
}

.nav-link:hover, .nav-link.active {
  color: #fff;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-gradient);
  border-radius: 2px;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  position: relative;
  padding: 60px 0 80px;
  overflow: hidden;
}

.hero-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 60px 50px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 40px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.hero-card::before {
  content: '';
  position: absolute;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, transparent 70%);
  top: -80px;
  right: -80px;
  pointer-events: none;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--accent-light);
  border: 1px solid var(--border-glow);
  color: #a5b4fc;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
}

.hero-title {
  font-size: 44px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 18px;
}

.hero-title span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 480px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 28px;
  border-radius: var(--radius-full);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: var(--transition);
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.6);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-img-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
}

.hero-img-wrap img {
  border-radius: var(--radius-lg);
  transform: scale(1.02);
  transition: var(--transition);
}

.hero-card:hover .hero-img-wrap img {
  transform: scale(1.06);
}

/* ============================================================
   FEATURES STRIP
   ============================================================ */
.features-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 60px;
}

.feature-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
  backdrop-filter: var(--backdrop);
}

.feature-box:hover {
  transform: translateY(-3px);
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #a5b4fc;
  flex-shrink: 0;
}

.feature-title {
  font-size: 14.5px;
  font-weight: 700;
  margin-bottom: 2px;
}

.feature-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
}

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
}

.section-tag {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  margin-bottom: 6px;
}

.section-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.section-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.section-link:hover {
  gap: 10px;
  color: #a5b4fc;
}

/* ============================================================
   CATEGORIES GRID
   ============================================================ */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 60px;
}

.cat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  transition: var(--transition);
  backdrop-filter: var(--backdrop);
  display: block;
}

.cat-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.2);
}

.cat-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.cat-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.cat-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================================
   PRODUCTS GRID
   ============================================================ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  margin-bottom: 60px;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  backdrop-filter: var(--backdrop);
  display: flex;
  flex-direction: column;
  position: relative;
}

.product-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-glow);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.45);
}

.product-thumb {
  position: relative;
  aspect-ratio: 1/1;
  background: #111624;
  overflow: hidden;
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.product-card:hover .product-thumb img {
  transform: scale(1.08);
}

.product-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--badge-gradient);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.product-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #fbbf24;
  font-size: 13px;
  font-weight: 600;
}

.product-title {
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 10px;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-title a:hover {
  color: var(--accent);
}

.product-price-row {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.price-current {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

.price-old {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 6px;
}

.btn-cart {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-cart:hover {
  background: var(--accent-hover);
  transform: scale(1.08);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
}

/* ============================================================
   CART PAGE
   ============================================================ */
.cart-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 32px;
  margin-top: 32px;
}

.cart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  backdrop-filter: var(--backdrop);
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
}

.cart-table th {
  text-align: left;
  padding: 12px 16px;
  color: var(--text-muted);
  font-size: 13px;
  border-bottom: 1px solid var(--border-color);
}

.cart-table td {
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.cart-product {
  display: flex;
  align-items: center;
  gap: 16px;
}

.cart-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #111624;
  flex-shrink: 0;
}

.cart-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qty-control {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  width: 100px;
}

.qty-btn {
  background: transparent;
  border: none;
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-input {
  width: 36px;
  border: none;
  background: transparent;
  text-align: center;
  color: #fff;
  font-weight: 600;
  outline: none;
}

.cart-summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: sticky;
  top: 100px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 14.5px;
}

.summary-total {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  border-bottom: none;
  padding-top: 18px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  margin-top: auto;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 60px 0 30px;
  font-size: 14px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col h4 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 18px;
  color: #fff;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--accent);
  padding-left: 4px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 13px;
}

/* Toast */
.toast-box {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: rgba(18, 24, 38, 0.95);
  border: 1px solid var(--accent);
  color: #fff;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn .3s ease;
  backdrop-filter: var(--backdrop);
  font-size: 14px;
  font-weight: 500;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

@media (max-width: 900px) {
  .hero-card { grid-template-columns: 1fr; padding: 40px 24px; }
  .features-strip { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .cart-layout { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .features-strip { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .header-search { display: none; }
}
