:root {
  --cream: #FDF9F0;
  --primary: #7a5900;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-h: 64px;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--cream);
  min-height: 100%;
  min-height: 100svh;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

.bg-cream { background-color: var(--cream); }

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  display: inline-block;
  line-height: 1;
  vertical-align: middle;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 0.5rem;
  color: #605e58;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}
.nav-link:hover { color: #7a5900; background: #f5f3f3; }
.nav-active {
  color: #7a5900 !important;
  background: #e6e2d9 !important;
  font-weight: 700;
}

.main-canvas {
  padding: 1rem;
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 1.25rem);
}

@media (min-width: 1024px) {
  .sidebar-desktop { display: flex !important; }
  .mobile-topbar,
  .mobile-bottom-nav,
  .mobile-menu-overlay,
  .mobile-menu-drawer { display: none !important; }
  .pwa-banner#pwaBanner { display: none !important; }
  .main-canvas {
    margin-left: 16rem;
    margin-top: 4rem;
    padding: 2rem 2.5rem 3rem;
    min-height: calc(100vh - 4rem);
  }
  .pwa-banner#pushBanner {
    left: auto;
    right: 2rem;
    bottom: 2rem;
    width: 380px;
  }
}

@media (max-width: 1023px) {
  .sidebar-desktop, .desktop-topbar { display: none !important; }
  .main-canvas { margin-top: 3.5rem; }
}

.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(27, 28, 28, 0.45);
  z-index: 90;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.mobile-menu-overlay.open {
  display: block;
  opacity: 1;
}

.mobile-menu-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(300px, 86vw);
  background: #fbf9f9;
  border-right: 1px solid #d2c5b1;
  z-index: 95;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1rem calc(1.25rem + var(--safe-bottom));
  transform: translateX(-105%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 8px 0 30px rgba(0,0,0,0.08);
}
.mobile-menu-drawer.open {
  transform: translateX(0);
}

.mobile-bottom-nav {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 100 !important;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: #fbf9f9;
  border-top: 1px solid #d2c5b1;
  padding: 0.4rem 0.25rem;
  padding-bottom: max(0.4rem, var(--safe-bottom));
  min-height: var(--nav-h);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.mobile-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0.35rem 0.2rem;
  font-size: 10px;
  font-weight: 600;
  color: #605e58;
  border-radius: 0.5rem;
  flex: 1;
  max-width: 5rem;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.mobile-bottom-nav a .material-symbols-outlined { font-size: 22px; }
.mobile-bottom-nav a.active { color: #7a5900; }
.mobile-bottom-nav a.active .material-symbols-outlined {
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}

.cart-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #f4c566;
  color: #705100;
  font-size: 9px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

.card {
  background: #fff;
  border: 1px solid #d2c5b1;
  border-radius: 0.75rem;
}

.btn-primary {
  background: #7a5900;
  color: #fff;
  font-weight: 600;
  border-radius: 0.5rem;
  padding: 0.7rem 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  background: transparent;
  border: 1px solid #807665;
  color: #4e4637;
  font-weight: 600;
  border-radius: 0.5rem;
  padding: 0.7rem 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.btn-secondary:hover { background: #efeded; }

.input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #fff;
  border: 1px solid rgba(128,118,101,0.2);
  border-radius: 0.5rem;
  outline: none;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.input:focus {
  border-color: #7a5900;
  box-shadow: 0 0 0 3px rgba(122,89,0,0.15);
}

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.cart-sidebar {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

.pwa-banner {
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 0.75rem);
  z-index: 110;
  background: #1b1c1c;
  color: #fff;
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  display: none;
  align-items: flex-start;
  gap: 0.75rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
@media (min-width: 1024px) {
  .pwa-banner {
    left: auto;
    right: 2rem;
    bottom: 2rem;
    width: 380px;
  }
}
.pwa-banner.show { display: flex; }
.pwa-banner .pwa-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.pwa-banner .pwa-btn {
  background: #f4c566;
  color: #705100;
  font-size: 11px;
  font-weight: 800;
  padding: 0.45rem 0.7rem;
  border-radius: 0.5rem;
  border: none;
}
.pwa-banner .pwa-btn.ghost {
  background: transparent;
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.2);
}

.notif-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #ba1a1a;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
}
.notif-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 340px;
  max-width: calc(100vw - 2rem);
  background: #fff;
  border: 1px solid #d2c5b1;
  border-radius: 0.75rem;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
  z-index: 80;
  overflow: hidden;
}
.mobile-notif-panel {
  position: fixed;
  top: 3.5rem;
  left: 0.75rem;
  right: 0.75rem;
  width: auto;
  max-width: none;
  z-index: 85;
}
.notif-item {
  display: block;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(210,197,177,0.35);
  transition: background 0.15s;
}
.notif-item:hover { background: #f5f3f3; }
.notif-item.unread { background: #fdf6e8; }
