:root {
  --primary: #0a1f44;
  --primary-dark: #071632;
  --primary-rgb: 10, 31, 68;
  --soft-blue: #eaf1ff;
  --light-gray: #f5f7fb;
  --text-main: #1f2a3d;
  --text-muted: #64748b;
  --text-white: #ffffff;
  --text-white-soft: #d3e0ff;
  --text-white-link: #e5ecff;
  --price-dark: #8fb5ff;
  --rating: #f59e0b;
  --border-light: #d1d5db;
  --danger: #ef4444;
  --focus-border: #8db3ff;
  --focus-shadow: rgba(61, 112, 220, 0.2);
  --hero-gradient: linear-gradient(120deg, rgba(10, 31, 68, 0.96), rgba(25, 76, 170, 0.86));
  --auth-gradient: linear-gradient(140deg, rgba(10, 31, 68, 0.98), rgba(34, 85, 189, 0.9));
  --profile-gradient: linear-gradient(130deg, rgba(10, 31, 68, 0.98), rgba(33, 87, 192, 0.88));
  --card-hover-shadow: 0 16px 28px rgba(15, 23, 42, 0.14);
  --nav-shadow: 0 8px 18px rgba(10, 31, 68, 0.25);
  --status-pending-bg: #fff7ed;
  --status-pending-text: #c2410c;
  --status-shipped-bg: #eff6ff;
  --status-shipped-text: #1d4ed8;
  --status-delivered-bg: #ecfdf5;
  --status-delivered-text: #15803d;
  --stock-in: #15803d;
  --stock-low: #b45309;
  --stock-out: #b91c1c;
  --profile-border: rgba(255, 255, 255, 0.9);
  --profile-stats-bg: rgba(255, 255, 255, 0.12);
  --card-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  background: var(--light-gray);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.dark-mode {
  --light-gray: #0f172a;
  --soft-blue: #111d36;
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  background: var(--light-gray);
}

main {
  flex: 1 0 auto;
}

.navbar-custom {
  background: var(--primary);
  box-shadow: var(--nav-shadow);
}

.navbar-brand {
  font-weight: 800;
  letter-spacing: 0.4px;
}

.site-logo {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 50%;
}

.search-box {
  max-width: 460px;
}

.hero {
  border-radius: 1rem;
  padding: 3rem 2rem;
  background: var(--hero-gradient);
  color: var(--text-white);
}

.section-title {
  font-weight: 700;
  margin-bottom: 1rem;
}

.card-modern {
  border: 0;
  border-radius: 0.9rem;
  box-shadow: var(--card-shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card-modern:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-hover-shadow);
}

.product-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-top-left-radius: 0.9rem;
  border-top-right-radius: 0.9rem;
}

.price {
  color: var(--primary);
  font-weight: 700;
}

body.dark-mode .price {
  color: var(--price-dark);
}

.rating {
  color: var(--rating);
  font-size: 0.9rem;
}

.wishlist-btn {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: var(--text-white);
  color: var(--danger);
}

.wishlist-btn:hover {
  background: var(--danger);
  color: var(--text-white);
}

.cart-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 0.72rem;
}

.icon-btn {
  position: relative;
  color: var(--text-white);
}

.category-tile {
  background: var(--text-white);
  border-radius: 0.8rem;
  box-shadow: var(--card-shadow);
  padding: 1.25rem;
  text-align: center;
}

.category-icon {
  font-size: 1.9rem;
  color: var(--primary);
}

.sidebar-card {
  border: 0;
  border-radius: 0.85rem;
  box-shadow: var(--card-shadow);
}

.thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 0.55rem;
  border: 2px solid transparent;
  cursor: pointer;
}

.thumb.active {
  border-color: var(--primary);
}

.footer {
  background: var(--primary);
  color: var(--text-white-soft);
}

.footer a {
  color: var(--text-white-link);
  text-decoration: none;
}

.footer a:hover {
  color: var(--text-white);
}

.auth-card {
  max-width: 920px;
}

.auth-premium {
  background: var(--text-white);
}

.auth-panel {
  min-height: 100%;
  background: var(--auth-gradient);
}

.auth-premium .form-control:focus {
  border-color: var(--focus-border);
  box-shadow: 0 0 0 0.2rem var(--focus-shadow);
}

.status-pill {
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
}

.status-pending {
  background: var(--status-pending-bg);
  color: var(--status-pending-text);
}

.status-shipped {
  background: var(--status-shipped-bg);
  color: var(--status-shipped-text);
}

.status-delivered {
  background: var(--status-delivered-bg);
  color: var(--status-delivered-text);
}

.status-inprogress {
  background: var(--status-shipped-bg);
  color: var(--status-shipped-text);
}

.status-resolved {
  background: var(--status-delivered-bg);
  color: var(--status-delivered-text);
}

.topbar-responsive {
  gap: 0.75rem;
}

.product-actions {
  display: flex;
  gap: 0.5rem;
}

.qty-box {
  max-width: 120px;
}

.order-row {
  gap: 0.75rem;
}

.stock-label {
  font-weight: 600;
}

.stock-in {
  color: var(--stock-in);
}

.stock-low {
  color: var(--stock-low);
}

.stock-out {
  color: var(--stock-out);
}

.profile-hero {
  border-radius: 1rem;
  background: var(--profile-gradient);
}

.profile-avatar {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--profile-border);
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  background: var(--profile-stats-bg);
  border-radius: 0.8rem;
  padding: 0.75rem;
}

.profile-stats div {
  text-align: center;
  color: var(--text-white);
}

.profile-stats strong {
  display: block;
  font-size: 1.05rem;
}

.profile-stats span {
  font-size: 0.72rem;
  opacity: 0.82;
}

.profile-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1rem;
}

.profile-info-grid small {
  display: block;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.profile-info-grid p {
  margin: 0;
  font-weight: 600;
}

.fade-in {
  animation: fadeIn 0.45s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

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

@media (max-width: 768px) {
  .product-img {
    height: 190px;
  }

  .auth-card {
    max-width: 520px;
  }

  .topbar-responsive {
    flex-wrap: wrap;
  }

  .topbar-responsive .form-select {
    max-width: 100% !important;
  }

  .product-actions {
    flex-wrap: wrap;
  }

  .product-actions .btn {
    flex: 1 1 auto;
  }

  .product-actions .wishlist-btn {
    flex: 0 0 35px;
  }

  .order-row {
    flex-wrap: wrap;
    align-items: flex-start !important;
  }

  .profile-info-grid {
    grid-template-columns: 1fr;
  }

  .category-tile {
    background: #fff;
    border-radius: 12px;
    padding: 18px 12px;
    min-height: 95px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    width: 100%;
  }

  .category-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.10);
  }

  .category-icon {
    font-size: 2rem;
    color: #0d6efd;
    line-height: 1;
  }
}