:root {
  --brand-green: #5B7917;
  --brand-olive: #899D31;
  --brand-sage: #859864;
  --brand-cream: #F6F1E6;
  --brand-pale: #FBFAF5;
  --brand-ink: #31420F;
  --surface: #FFFFFF;
  --border-soft: rgba(133, 152, 100, 0.24);
  --shadow-soft: 0 12px 30px rgba(65, 83, 33, 0.11);
  --shadow-lift: 0 18px 42px rgba(65, 83, 33, 0.18);
  --radius-md: 12px;
  --radius-lg: 18px;
  --transition-smooth: 180ms ease;
}

/* ===== GLOBAL ===== */
* {
  box-sizing: border-box;
}

html, body {
  width: 100%;
  margin: 0;
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at top left, rgba(137, 157, 49, 0.12), transparent 32rem),
    linear-gradient(180deg, var(--brand-pale) 0%, var(--brand-cream) 100%);
  color: var(--brand-green);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, video {
  max-width: 100%;
  height: auto;
}

a,
button,
input,
textarea,
select {
  font: inherit;
}

a,
button {
  transition: color var(--transition-smooth), background-color var(--transition-smooth), border-color var(--transition-smooth), box-shadow var(--transition-smooth), transform var(--transition-smooth);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(137, 157, 49, 0.28);
  outline-offset: 3px;
}

h1,
h2,
h3 {
  color: var(--brand-green);
  letter-spacing: 0;
  line-height: 1.16;
}

p {
  color: #607437;
}

main {
  animation: pageFadeIn 0.42s ease both;
}

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== HEADER ===== */
.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(255, 255, 255, 0.92);
  padding: 12px 28px;
  box-shadow: 0 8px 24px rgba(65, 83, 33, 0.1);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* ===== HEADER ROW ===== */
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* ===== BRAND ===== */
.header-brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--brand-green);
  font-size: 1.2rem;
}

/* ===== CART ICON ===== */
.cart-icon {
  position: relative;
}

.cart-icon a {
  color: var(--brand-green);
  text-decoration: none;
  font-size: 24px;
  display: flex;
  align-items: center;
}

/* COUNT BADGE */
.cart-count {
  position: absolute;
  top: -6px;
  right: -10px;
  background: var(--brand-green);
  color: white;
  border-radius: 50%;
  padding: 2px 7px;
  font-size: 12px;
  font-weight: bold;
}

/* ===== SIDEBAR BUTTON ===== */
.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background-color: var(--surface);
  color: var(--brand-green);
  font-size: 20px;
  cursor: pointer;
  transition: 0.2s;
}

.sidebar-toggle:hover {
  background-color: var(--brand-cream);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(65, 83, 33, 0.12);
}

/* ===== SIDEBAR ===== */
.site-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: min(280px, 82vw);
  height: 100vh;
  background: linear-gradient(180deg, var(--brand-olive), var(--brand-green));
  color: #FFFFFF;
  padding: 24px 16px;
  box-shadow: 10px 0 30px rgba(38, 52, 15, 0.22);
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  z-index: 1200;
  overflow-y: auto;
}

.site-sidebar .sidebar-title {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 18px;
  letter-spacing: 0.02em;
}

/* LINKS */
.site-sidebar a {
  display: block;
  color: #FFFFFF;
  text-decoration: none;
  padding: 11px 13px;
  border-radius: 12px;
  margin-bottom: 8px;
  font-weight: 600;
  transition: all 0.22s ease;
}

.site-sidebar a:hover,
.site-sidebar a:focus-visible {
  background-color: rgba(255, 255, 255, 0.92);
  color: var(--brand-green);
  transform: translateX(4px);
}

.site-sidebar a.active {
  background-color: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
  box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.82);
}

/* OPEN STATE */
.sidebar-open .site-sidebar {
  transform: translateX(0);
}

/* OVERLAY */
.sidebar-open::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(25, 35, 14, 0.35);
  backdrop-filter: blur(2px);
  z-index: 1100;
}

/* ===== NAV ===== */
nav {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  font-weight: 600;
}

nav a {
  color: var(--brand-green);
  font-size: 20px;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 10px;
  transition: 0.25s;
}

nav a:hover {
  background-color: var(--brand-cream);
  color: var(--brand-olive);
  transform: translateY(-2px);
}

/* ===== GOOGLE BTN ===== */
.google-btn {
  display: inline-block;
  margin-top: 12px;
  background-color: #FFFFFF;
  color: var(--brand-green);
  border: 1px solid var(--border-soft);
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.google-btn:hover {
  background-color: var(--brand-cream);
}

.btn,
.details-btn,
.browse-btn,
.checkout-btn,
.clear-btn,
#addToCartBtn,
.checkout-box button {
  border: 0;
  border-radius: 999px;
  box-shadow: 0 10px 22px rgba(91, 121, 23, 0.18);
  letter-spacing: 0.01em;
}

.btn:hover,
.details-btn:hover,
.browse-btn:hover,
.checkout-btn:hover,
.clear-btn:hover,
#addToCartBtn:hover,
.checkout-box button:hover {
  box-shadow: var(--shadow-lift);
}

.product-card,
.category-card,
.cart-container,
.checkout-box,
.product-details,
.about-container,
.contact-container {
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
}

input,
textarea,
select {
  border-color: var(--border-soft);
}

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

/* ===== TABLET ===== */
@media (max-width: 768px) {
  .main-header {
    padding: 12px 18px;
  }

  .header-brand {
    font-size: 1.1rem;
  }

  nav {
    flex-direction: column;
    gap: 10px;
  }

  nav a {
    width: 100%;
    text-align: center;
  }

  .site-sidebar {
    width: min(260px, 85vw);
  }
}

/* ===== MOBILE ===== */
@media (max-width: 480px) {
  .main-header {
    padding: 10px 14px;
  }

  .sidebar-toggle {
    width: 38px;
    height: 38px;
  }

  .cart-icon a {
    font-size: 22px;
  }

  .cart-count {
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .reveal-on-scroll {
    opacity: 1;
    transform: none;
  }
}
