:root {
  --primary-color: #28b244;
  --primary-strong: #1e3d22;
  --accent-color: #ff6b35;
  --accent-strong: #e55a2b;

  --bg: #f8f9fa;
  --surface: #ffffff;
  --surface-soft: #f8f9fa;
  --text: #2c3e50;
  --text-muted: #6c757d;
  --border: #e9ecef;

  --success: #28b244;
  --warning: #ffc107;
  --danger: #dc3545;
  --info: #17a2b8;

  --shadow-sm: 0 4px 14px rgba(15, 33, 24, 0.07);
  --shadow-md: 0 12px 28px rgba(15, 33, 24, 0.1);
  --shadow-lg: 0 20px 45px rgba(15, 33, 24, 0.14);
  --shadow-xl: 0 26px 52px rgba(15, 33, 24, 0.2);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-2xl: 30px;

  --spacing-xs: 0.35rem;
  --spacing-sm: 0.6rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.45rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 2.9rem;
  --spacing-3xl: 3.8rem;

  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;

  /* Backward-compatible aliases used by existing page styles */
  --primary-light: #4a7c59;
  --primary-dark: var(--primary-strong);
  --secondary-color: var(--accent-color);
  --secondary-light: #ff8c42;
  --secondary-dark: var(--accent-strong);
  --white: #ffffff;
  --light-gray: #f8f9fa;
  --gray: #181f27;
  --dark-gray: #495057;
  --dark: var(--text);
  --black: #000000;
  --bg-primary: var(--surface);
  --bg-secondary: var(--bg);
  --bg-dark: var(--primary-strong);
  --text-primary: var(--text);
  --text-secondary: var(--text-muted);
  --text-light: #ffffff;
  --border-light: #e9ecef;
  --border-medium: #dee2e6;
  --border-dark: var(--primary-color);
  --success-light: #d4edda;
  --warning-light: #fff3cd;
  --danger-light: #f8d7da;
  --info-light: #d1ecf1;
  --gradient-primary: linear-gradient(135deg, #28b244 0%, #4a7c59 100%);
  --gradient-secondary: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
  --gradient-light: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  --radius-full: 999px;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.85rem;
  --font-size-4xl: 2.35rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.app-shell {
  margin: 0;
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(900px 380px at -10% -10%, rgba(40, 178, 68, 0.14), transparent 60%),
    radial-gradient(850px 360px at 100% -10%, rgba(255, 107, 53, 0.11), transparent 58%),
    var(--bg);
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Outfit", "Plus Jakarta Sans", sans-serif;
  color: #102218;
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

p {
  color: var(--text-muted);
}

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

a:hover {
  color: var(--primary-strong);
}

.site-main {
  padding-top: 92px;
  min-height: calc(100vh - 250px);
}

.site-nav {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(22, 62, 35, 0.08);
  box-shadow: 0 6px 20px rgba(18, 35, 24, 0.06);
  padding: 0.65rem 0;
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: "Outfit", sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--primary-color) !important;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  background: transparent;
}

.nav-link {
  color: var(--text) !important;
  font-weight: 600;
  padding: 0.55rem 0.8rem !important;
  border-radius: 10px;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color) !important;
  background: rgba(40, 178, 68, 0.08);
}

.nav-cart-quick {
  border-width: 1px;
  border-radius: 12px;
  padding: 0.4rem 0.7rem;
}

.nav-cart-counter {
  background: #28b244;
  color: #ffffff;
  border-radius: 999px;
  min-width: 20px;
  height: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  margin-left: 0.4rem;
  vertical-align: middle;
  box-shadow: 0 0 0 2px rgba(40, 178, 68, 0.18);
}

.dropdown-menu {
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 0.4rem;
}

.dropdown-item {
  border-radius: 10px;
  padding: 0.45rem 0.65rem;
}

.dropdown-item:hover {
  background: rgba(40, 178, 68, 0.08);
}

.container,
.container-fluid {
  position: relative;
  z-index: 1;
}

.card,
.profile-card,
.order-card,
.product-detail-card,
.related-product-card,
.filter-card,
.stats-card {
  background: var(--surface);
  border: 1px solid rgba(19, 32, 25, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-header {
  background: linear-gradient(180deg, #ffffff, #f6faf6);
  border-bottom: 1px solid var(--border);
  border-top-left-radius: var(--radius-lg) !important;
  border-top-right-radius: var(--radius-lg) !important;
}

.card-footer {
  border-top: 1px solid var(--border);
  background: #f9fcf9;
}

.btn {
  border-radius: 12px;
  font-weight: 700;
  border: none;
  letter-spacing: 0.01em;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary-color), #11542d);
  box-shadow: 0 8px 22px rgba(20, 83, 45, 0.24);
}

.btn-primary:hover {
  color: #fff;
  background: linear-gradient(135deg, #166534, #0f3f23);
}

.btn-outline-primary {
  color: var(--primary-color);
  border: 1px solid rgba(40, 178, 68, 0.45);
  background: #fff;
}

.btn-outline-primary:hover {
  color: #fff;
  background: var(--primary-color);
}

.btn-outline-secondary {
  color: var(--accent-strong);
  border: 1px solid rgba(194, 65, 12, 0.35);
  background: #fff;
}

.btn-outline-secondary:hover {
  color: #fff;
  background: var(--accent-strong);
}

.form-control,
.form-select,
.quantity-input {
  border: 1px solid #cad9cc;
  border-radius: 12px;
  color: var(--text);
  background: #fff;
}

.form-control:focus,
.form-select:focus,
.quantity-input:focus {
  border-color: rgba(40, 178, 68, 0.6);
  box-shadow: 0 0 0 0.2rem rgba(40, 178, 68, 0.14);
}

.alert {
  border-radius: 12px;
  border-width: 1px;
}

.badge {
  border-radius: 999px;
  font-weight: 700;
}

.breadcrumb {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem 1rem;
}

.table {
  --bs-table-bg: transparent;
  border-radius: 14px;
  overflow: hidden;
}

.table > :not(caption) > * > * {
  border-bottom-color: #e7ece7;
}

.modal-content {
  border-radius: 16px;
  border: 1px solid var(--border);
}

.page-header,
.orders-header,
.profile-header,
.category-header,
.hero-section {
  background: linear-gradient(135deg, #28b244 0%, #4a7c59 70%, #1e3d22 100%);
  color: #fff;
  border-radius: 22px;
  margin-bottom: 1.4rem;
  box-shadow: var(--shadow-md);
}

.page-header p,
.orders-header p,
.profile-header p,
.category-header p,
.hero-section p,
.page-header .lead,
.orders-header .lead,
.profile-header .lead,
.category-header .lead {
  color: rgba(255, 255, 255, 0.84);
}

.product-card,
.related-product-card {
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.product-card:hover,
.related-product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.product-card img,
.related-product-card img,
.product-image {
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 107, 53, 0.18), transparent 34%),
    radial-gradient(circle at 100% 100%, rgba(40, 178, 68, 0.16), transparent 32%),
    #f8f9fa;
}

.category-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.category-card:hover,
.category-card.active {
  border-color: rgba(40, 178, 68, 0.35);
  background: #f4faf5;
}

.cart-item {
  border: 1px solid rgba(17, 68, 39, 0.1);
  border-radius: 14px;
  background: #fff;
}

.order-status.pending {
  color: #8a5100;
  background: #fff4dc;
}

.order-status.processing {
  color: #0c4a6e;
  background: #dff3ff;
}

.order-status.shipped,
.order-status.delivered {
  color: #0f5d2f;
  background: #e6f8ec;
}

.order-status.cancelled {
  color: #8f1d1d;
  background: #ffe4e4;
}

.toast {
  border-radius: 12px;
  border: 1px solid #d9e4db;
  box-shadow: var(--shadow-lg);
}

.footer {
  margin-top: var(--spacing-2xl);
  padding: var(--spacing-2xl) 0 var(--spacing-xl);
  background:
    radial-gradient(650px 280px at 10% -15%, rgba(255, 255, 255, 0.08), transparent 54%),
    linear-gradient(140deg, #0f271a, #143524);
  color: rgba(246, 252, 248, 0.9);
}

.footer p,
.footer li {
  color: rgba(246, 252, 248, 0.8);
}

.footer h5 {
  color: #fff;
  margin-bottom: 1rem;
}

.footer a {
  color: rgba(237, 248, 241, 0.85);
}

.footer a:hover {
  color: #fff;
}

.footer .social-links a {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(236, 247, 240, 0.22);
  border-radius: 999px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

.animate-fade-in-up {
  animation: fadeInUp 0.55s ease both;
}

@media (max-width: 992px) {
  .site-main {
    padding-top: 86px;
  }

  .navbar-collapse {
    margin-top: 0.7rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    padding: 0.5rem;
  }
}

@media (max-width: 768px) {
  .site-main {
    padding-top: 82px;
  }

  .page-header,
  .orders-header,
  .profile-header,
  .category-header {
    border-radius: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
