/* Common & Shared */

/* Typography */
body, h1, h2, h3, h4, h5, h6, input, textarea, button, select {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
  letter-spacing: -0.015em;
}

h1, h2, h3, .font-serif-heading {
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.font-brand {
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  font-weight: 800;
  letter-spacing: 0.25em;
}

body {
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f8f6f0; }
.dark ::-webkit-scrollbar-track { background: #121614; }
::-webkit-scrollbar-thumb { background: #5a7d5a; border-radius: 99px; }

/* Utility Scrollbar */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Animasi Halaman */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

.animate-page {
  animation: fadeIn 0.6s ease forwards;
}

.animate-nav {
  animation: fadeInDown 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Scroll Reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-left.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-right.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-scale.is-visible {
  opacity: 1;
  transform: scale(1);
}

.stagger-1 { transition-delay: 0.05s; }
.stagger-2 { transition-delay: 0.1s; }
.stagger-3 { transition-delay: 0.15s; }
.stagger-4 { transition-delay: 0.2s; }
.stagger-5 { transition-delay: 0.25s; }
.stagger-6 { transition-delay: 0.3s; }
.stagger-7 { transition-delay: 0.35s; }
.stagger-8 { transition-delay: 0.4s; }

/* Navbar */

#main-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 50;
  background-color: rgba(255, 255, 255, 0.98);
  border: none !important;
  transition: top 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              bottom 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              padding 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              background-color 0.3s ease;
}

.dark #main-navbar {
  background-color: rgba(22, 28, 23, 0.98);
  border: none !important;
}

#navbar-container {
  transition: max-width 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  #navbar-container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  #navbar-container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

#navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
  border: 1px solid transparent;
  border-radius: 0px;
  transition: border-radius 0.35s ease,
              border-color 0.35s ease,
              background-color 0.35s ease,
              box-shadow 0.35s ease,
              height 0.35s ease,
              padding 0.35s ease;
}

@media (min-width: 640px) {
  #navbar-inner {
    height: 4.5rem;
  }
}

/* Navbar Scrolled */
#main-navbar.navbar-scrolled {
  background-color: transparent !important;
  border: none !important;
  pointer-events: none;
  top: auto;
  bottom: 1.25rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 768px) {
  #main-navbar.navbar-scrolled {
    top: 1rem;
    bottom: auto;
    padding-left: 0;
    padding-right: 0;
  }
}

#main-navbar.navbar-scrolled #navbar-container {
  max-width: 30rem;
  pointer-events: auto;
}

@media (min-width: 768px) {
  #main-navbar.navbar-scrolled #navbar-container {
    max-width: 36rem;
  }
}

#main-navbar.navbar-scrolled #navbar-inner {
  border-radius: 9999px;
  border-color: rgba(229, 231, 235, 0.9);
  box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.18), 0 10px 15px -5px rgba(0, 0, 0, 0.1);
  background-color: rgba(255, 255, 255, 0.98);
  height: 3.25rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  overflow: hidden;
}

@media (min-width: 640px) {
  #main-navbar.navbar-scrolled #navbar-inner {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

.dark #main-navbar.navbar-scrolled #navbar-inner {
  border-color: rgba(43, 52, 46, 0.9);
  box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.6);
  background-color: rgba(28, 34, 30, 0.98);
}

/* Brand Logo */
.nav-brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
  text-decoration: none;
}

.nav-brand-wrap:hover .nav-logo-img {
  transform: scale(1.05);
}

.nav-logo-img {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  transition: transform 0.2s ease;
}

@media (min-width: 640px) {
  .nav-logo-img {
    width: 2.25rem;
    height: 2.25rem;
  }
}

.nav-brand {
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  font-weight: 800;
  letter-spacing: 0.25em;
  font-size: 1.25rem;
  color: #111827;
  text-transform: lowercase;
  transition: opacity 0.2s ease;
}

.nav-brand:hover {
  opacity: 0.8;
}

@media (min-width: 640px) {
  .nav-brand {
    font-size: 1.5rem;
  }
}

.dark .nav-brand {
  color: #ffffff;
}

/* Desktop Nav Links */
.nav-links-wrap {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

@media (max-width: 767px) {
  .nav-links-wrap {
    display: none !important;
  }
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #4b5563;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.dark .nav-link { color: #9ca3af; }
.nav-link:hover { color: #111827; background-color: rgba(0, 0, 0, 0.05); }
.dark .nav-link:hover { color: #ffffff; background-color: rgba(255, 255, 255, 0.08); }
.nav-link.active { color: #2d5332; background-color: rgba(90, 125, 90, 0.14); font-weight: 700; }
.dark .nav-link.active { color: #8ab88a; background-color: rgba(107, 149, 107, 0.22); }

#main-navbar.navbar-scrolled .nav-links-wrap {
  display: none !important;
}

/* Kontrol Navbar */
.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .nav-controls {
    gap: 0.75rem;
  }
}

.nav-icon-btn {
  position: relative;
  padding: 0.5rem;
  border-radius: 9999px;
  border: 1px solid #e5e7eb;
  background-color: #f9fafb;
  color: #374151;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.nav-icon-btn:hover {
  background-color: #f3f4f6;
}

.dark .nav-icon-btn {
  border-color: #2b342e;
  background-color: #1c221e;
  color: #e5e7eb;
}

.dark .nav-icon-btn:hover {
  background-color: #252e28;
}

.nav-cart-badge {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  background-color: #5a7d5a;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  width: 1rem;
  height: 1rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ffffff;
}

.dark .nav-cart-badge {
  border-color: #161c17;
}

.btn-auth-google {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  color: #374151;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

@media (min-width: 640px) {
  .btn-auth-google {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
}

.btn-auth-google:hover {
  background-color: #f9fafb;
}

.dark .btn-auth-google {
  background-color: #1c221e;
  border-color: #2b342e;
  color: #e5e7eb;
}

.dark .btn-auth-google:hover {
  background-color: #252e28;
}

/* Mobile Nav */
.mobile-nav-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding-left: 1rem;
  padding-right: 1rem;
  padding-top: 5rem;
  padding-bottom: 0.25rem;
}

@media (min-width: 768px) {
  .mobile-nav-bar {
    display: none;
  }
}

.mobile-nav-inner {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(229, 231, 235, 0.7);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(4px);
}

.dark .mobile-nav-inner {
  background-color: rgba(28, 34, 30, 0.8);
  border-color: #2b342e;
}

.nav-link-mobile {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  color: #4b5563;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.dark .nav-link-mobile { color: #9ca3af; }
.nav-link-mobile:hover { color: #111827; background-color: rgba(0, 0, 0, 0.04); }
.dark .nav-link-mobile:hover { color: #f3f4f6; background-color: rgba(255, 255, 255, 0.06); }
.nav-link-mobile.active { color: #2d5332; background-color: rgba(90, 125, 90, 0.15); font-weight: 700; }
.dark .nav-link-mobile.active { color: #8ab88a; background-color: rgba(107, 149, 107, 0.25); }

/* Footer */

.footer-root {
  background-color: #ffffff;
  color: #4b5563;
  padding-top: 3rem;
  padding-bottom: 9rem;
  border-top: 1px solid #f3f4f6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

@media (min-width: 640px) {
  .footer-root {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }
}

.dark .footer-root {
  background-color: #0d120e;
  color: #9ca3af;
  border-top-color: #2b342e;
}

.footer-container {
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 640px) {
  .footer-container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .footer-container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.footer-brand {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.footer-brand.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.social-link {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.social-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}
.social-link:active {
  transform: scale(0.97);
}

/* Floating WhatsApp */

.floating-help {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  animation: floatBounce 4s ease-in-out infinite;
}
.floating-help:hover {
  animation-play-state: paused;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 28px rgba(37, 211, 102, 0.4);
}
.floating-help:active {
  transform: scale(0.95);
}

@keyframes floatBounce {
  0%, 100% { transform: translateY(0); }
  25%      { transform: translateY(-6px); }
  50%      { transform: translateY(0); }
  75%      { transform: translateY(-3px); }
}

.floating-wa-pill {
  position: fixed;
  bottom: 5rem;
  right: 1rem;
  z-index: 40;
  background-color: #25d366;
  color: #ffffff;
  padding: 0.75rem 1rem;
  border-radius: 9999px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 600;
  font-size: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-decoration: none;
}

@media (min-width: 640px) {
  .floating-wa-pill {
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.875rem 1.25rem;
    font-size: 0.875rem;
  }
}

.floating-wa-pill:hover {
  background-color: #1eb956;
}

.ping-dot-wrap {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  display: flex;
  width: 0.625rem;
  height: 0.625rem;
}

.ping-dot {
  position: relative;
  display: inline-flex;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 9999px;
  background-color: #ffffff;
  animation: pingPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pingPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

/* Cart Drawer */

.cart-drawer {
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.cart-drawer.open {
  transform: translateX(0);
}

.cart-drawer-backdrop {
  opacity: 0;
  transition: opacity 0.3s ease;
}
.cart-drawer-backdrop.open {
  opacity: 1;
}

/* Animasi Modal */

.modal-backdrop {
  background: rgba(15, 23, 42, 0.6);
  animation: fadeIn 0.25s ease forwards;
}

.modal-content {
  animation: modalEnter 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalEnter {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-exit {
  animation: modalExit 0.2s ease forwards;
}

@keyframes modalExit {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.95) translateY(10px); }
}

/* Tombol */

.btn-wa {
  background: #25d366;
  color: white;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}
.btn-wa:hover {
  background: #1eb956;
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.35);
  transform: translateY(-1px);
}
.btn-wa:active {
  transform: scale(0.97);
}

.btn-primary {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(90, 125, 90, 0.25);
}
.btn-primary:active {
  transform: scale(0.97);
}

.btn-ghost {
  transition: all 0.2s ease;
}
.btn-ghost:hover {
  transform: translateY(-1px);
}
.btn-ghost:active {
  transform: scale(0.97);
}

/* Toast */

.toast-notification {
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translate(-50%, 20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

.toast-notification.toast-out {
  animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideOut {
  from { opacity: 1; transform: translate(-50%, 0) scale(1); }
  to   { opacity: 0; transform: translate(-50%, -10px) scale(0.9); }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .floating-help {
    animation: none !important;
  }
}
