/* ============================================================
   SayurHub – Stylesheet
   Modern, premium vegetable e-commerce landing page
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@600;700;800&display=swap");

/* ---------- Design Tokens ---------- */
:root {
  --green-900: #1b4332;
  --green-800: #2d6a4f;
  --green-700: #40916c;
  --green-500: #52b788;
  --green-300: #95d5b2;
  --green-100: #d8f3dc;

  --yellow-400: #f9c74f;
  --yellow-500: #f9844a;

  --red-400: #e63946;

  --surface: #0d1117;
  --surface-card: rgba(255, 255, 255, 0.06);
  --surface-card-hover: rgba(255, 255, 255, 0.1);
  --surface-overlay: rgba(0, 0, 0, 0.55);

  --text-primary: #f0f6f0;
  --text-secondary: #a7c4a7;
  --text-muted: #6b8f6b;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.25);
  --shadow-hover: 0 8px 40px rgba(82, 183, 136, 0.2);

  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  --max-width: 1200px;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--surface);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
}

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

/* ---------- Utility ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 16px 0;
  transition: background var(--transition), box-shadow var(--transition);
}

.navbar.scrolled {
  background: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

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

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Outfit", sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--green-300);
}

.navbar-brand .logo-icon {
  font-size: 1.8rem;
}

.cart-btn {
  position: relative;
  background: var(--surface-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  color: var(--text-primary);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background var(--transition), transform var(--transition);
}

.cart-btn:hover {
  background: var(--surface-card-hover);
  transform: translateY(-1px);
}

.cart-badge {
  background: var(--green-500);
  color: var(--green-900);
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition);
}

.cart-badge.bounce {
  animation: badgeBounce 0.4s ease;
}

@keyframes badgeBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.4); }
}

/* ---------- Hero Section ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: 80px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(45, 106, 79, 0.35) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 20%, rgba(82, 183, 136, 0.2) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 90%, rgba(249, 199, 79, 0.12) 0%, transparent 40%);
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(82, 183, 136, 0.15);
  border: 1px solid rgba(82, 183, 136, 0.3);
  border-radius: 100px;
  padding: 8px 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--green-300);
  margin-bottom: 24px;
  animation: fadeInUp 0.6s ease both;
}

.hero h1 {
  font-family: "Outfit", sans-serif;
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  animation: fadeInUp 0.6s ease 0.1s both;
}

.hero h1 .highlight {
  background: linear-gradient(135deg, var(--green-300), var(--yellow-400));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-tagline {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 36px;
  line-height: 1.7;
  animation: fadeInUp 0.6s ease 0.2s both;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--green-700), var(--green-500));
  color: #fff;
  padding: 16px 36px;
  border-radius: 100px;
  font-size: 1.05rem;
  font-weight: 600;
  transition: transform var(--transition), box-shadow var(--transition);
  animation: fadeInUp 0.6s ease 0.3s both;
}

.hero-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(82, 183, 136, 0.35);
}

.hero-cta .arrow {
  transition: transform var(--transition);
}

.hero-cta:hover .arrow {
  transform: translateX(4px);
}

/* Floating emojis decoration */
.hero-deco {
  position: absolute;
  font-size: 2.5rem;
  opacity: 0.35;
  animation: float 6s ease-in-out infinite;
  z-index: 0;
}

.hero-deco:nth-child(1) { top: 15%; left: 8%; animation-delay: 0s; }
.hero-deco:nth-child(2) { top: 25%; right: 10%; animation-delay: 1.5s; font-size: 2rem; }
.hero-deco:nth-child(3) { bottom: 20%; left: 12%; animation-delay: 3s; font-size: 3rem; }
.hero-deco:nth-child(4) { bottom: 30%; right: 8%; animation-delay: 0.8s; }
.hero-deco:nth-child(5) { top: 50%; left: 5%; animation-delay: 2s; font-size: 2rem; }
.hero-deco:nth-child(6) { top: 40%; right: 5%; animation-delay: 4s; font-size: 1.8rem; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-18px) rotate(8deg); }
}

/* ---------- Section Header ---------- */
.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-family: "Outfit", sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 12px;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

/* ---------- Price Disclaimer ---------- */
.price-disclaimer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 36px;
  padding: 14px 24px;
  background: rgba(249, 199, 79, 0.08);
  border: 1px solid rgba(249, 199, 79, 0.25);
  border-radius: var(--radius-sm);
}

.price-disclaimer .icon {
  font-size: 1.2rem;
}

.price-disclaimer .text {
  font-size: 0.88rem;
  color: var(--yellow-400);
  font-weight: 500;
}

.price-disclaimer .date {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* ---------- Category Filter ---------- */
.category-filters {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.filter-btn {
  background: var(--surface-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  padding: 8px 20px;
  border-radius: 100px;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--green-700);
  color: #fff;
  border-color: var(--green-700);
}

/* ---------- Products Section ---------- */
.products-section {
  padding: 100px 0 80px;
  position: relative;
}

.products-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 24px;
}

/* ---------- Product Card ---------- */
.product-card {
  background: var(--surface-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.product-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green-500), var(--yellow-400));
  opacity: 0;
  transition: opacity var(--transition);
}

.product-card:hover {
  transform: translateY(-6px);
  background: var(--surface-card-hover);
  box-shadow: var(--shadow-hover);
  border-color: rgba(82, 183, 136, 0.2);
}

.product-card:hover::before {
  opacity: 1;
}

.product-emoji {
  font-size: 3.5rem;
  margin-bottom: 16px;
  display: block;
  transition: transform var(--transition);
}

.product-card:hover .product-emoji {
  transform: scale(1.15) rotate(-5deg);
}

.product-name {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.product-category {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.product-price {
  font-family: "Outfit", sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--green-300);
  margin-bottom: 4px;
}

.product-unit {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.add-to-cart-btn {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--green-800), var(--green-700));
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition);
}

.add-to-cart-btn:hover {
  background: linear-gradient(135deg, var(--green-700), var(--green-500));
  box-shadow: 0 4px 15px rgba(82, 183, 136, 0.3);
}

.add-to-cart-btn.added {
  background: var(--green-500);
  color: var(--green-900);
}

/* ---------- Cart Overlay & Drawer ---------- */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: var(--surface-overlay);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

.cart-overlay.open {
  opacity: 1;
  visibility: visible;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 92vw;
  height: 100vh;
  background: #151b23;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 2001;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-drawer.open {
  transform: translateX(0);
}

.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cart-drawer-header h3 {
  font-family: "Outfit", sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.close-cart-btn {
  background: var(--surface-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: background var(--transition);
}

.close-cart-btn:hover {
  background: rgba(230, 57, 70, 0.2);
  color: var(--red-400);
}

/* Cart Items */
.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  gap: 12px;
}

.cart-empty .empty-icon {
  font-size: 3rem;
  opacity: 0.5;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.cart-item-emoji {
  font-size: 2rem;
  flex-shrink: 0;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price {
  font-size: 0.85rem;
  color: var(--green-300);
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.qty-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-xs);
  background: var(--surface-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.qty-btn:hover {
  background: var(--surface-card-hover);
}

.qty-btn.remove:hover {
  background: rgba(230, 57, 70, 0.2);
  color: var(--red-400);
  border-color: rgba(230, 57, 70, 0.3);
}

.cart-item-qty {
  font-weight: 600;
  min-width: 24px;
  text-align: center;
  font-size: 0.95rem;
}

/* Cart Footer */
.cart-footer {
  padding: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.cart-total-label {
  font-size: 1rem;
  color: var(--text-secondary);
}

.cart-total-value {
  font-family: "Outfit", sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--green-300);
}

.checkout-btn {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #25d366, #128c7e);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all var(--transition);
}

.checkout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(37, 211, 102, 0.35);
}

.checkout-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.checkout-btn .wa-icon {
  font-size: 1.3rem;
}

/* ---------- Footer ---------- */
.footer {
  padding: 48px 0 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  text-align: center;
}

.footer-brand {
  font-family: "Outfit", sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--green-300);
  margin-bottom: 8px;
}

.footer p {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer-links {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 24px;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.88rem;
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--green-300);
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Scrollbar ---------- */
.cart-items::-webkit-scrollbar {
  width: 6px;
}

.cart-items::-webkit-scrollbar-track {
  background: transparent;
}

.cart-items::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

/* ---------- Toast Notification ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--green-800);
  color: #fff;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 500;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  z-index: 5000;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .hero {
    min-height: 90vh;
  }

  .hero-deco {
    font-size: 1.8rem;
    opacity: 0.2;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
  }

  .product-card {
    padding: 20px 16px;
  }

  .product-emoji {
    font-size: 2.5rem;
  }

  .product-price {
    font-size: 1.1rem;
  }

  .cart-drawer {
    width: 100vw;
    max-width: 100vw;
  }

  .price-disclaimer {
    flex-direction: column;
    text-align: center;
    gap: 4px;
  }
}

@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .product-card {
    padding: 16px 12px;
  }

  .add-to-cart-btn {
    font-size: 0.82rem;
    padding: 10px;
  }
}
