/* ─── Mobile Bottom Nav ─── */

.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  background: rgba(10, 7, 5, 0.97);
  border-top: 1px solid rgba(201, 162, 52, 0.18);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 0 0.25rem env(safe-area-inset-bottom, 0.5rem);
  height: 64px;
  align-items: stretch;
}

.mobile-bottom-nav .bnav-list {
  display: flex;
  align-items: stretch;
  width: 100%;
  position: relative;
}

.bnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0.5rem 0.25rem 0.25rem;
  color: rgba(181, 151, 106, 0.45);
  transition: color 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  border: none;
  background: none;
  font-family: inherit;
}

.bnav-item svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.75;
  transition: stroke 0.2s ease, transform 0.2s ease;
}

.bnav-label {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1;
  transition: color 0.2s ease;
}

.bnav-item.active {
  color: var(--color-primary);
}

.bnav-item.active svg {
  stroke: var(--color-primary);
  transform: translateY(-1px);
}

.bnav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 2px;
  background: var(--color-primary);
  border-radius: 0 0 2px 2px;
}

.bnav-item:active svg {
  transform: scale(0.88) translateY(-1px);
}

/* Menu button open state */
#bnav-menu-btn.menu-open {
  color: var(--color-primary);
}

#bnav-menu-btn.menu-open::before {
  content: '';
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 2px;
  background: var(--color-primary);
  border-radius: 0 0 2px 2px;
}

/* Cart button */
.bnav-cart-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 0.25rem;
}

.bnav-cart-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: rgba(181, 151, 106, 0.45);
  text-decoration: none;
  cursor: pointer;
  position: relative;
  padding: 0.5rem 0.25rem 0.25rem;
  width: 100%;
  transition: color 0.2s ease;
}

.bnav-cart-btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.75;
  transition: stroke 0.2s ease, transform 0.2s ease;
}

.bnav-cart-btn.active {
  color: var(--color-primary);
}

.bnav-cart-btn.active svg {
  stroke: var(--color-primary);
}

.bnav-cart-btn.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 2px;
  background: var(--color-primary);
  border-radius: 0 0 2px 2px;
}

.bnav-cart-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 18px);
  background: var(--color-secondary);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 1.5px solid rgba(10, 7, 5, 0.9);
}

.bnav-cart-badge.visible {
  display: flex;
}

/* ─── Mobile Drawer ─── */

.mobile-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1050;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-drawer-overlay.open {
  opacity: 1;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 88vw);
  background: var(--color-dark-2);
  border-left: 1px solid var(--color-border);
  z-index: 1060;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom, 1rem);
}

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

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.drawer-close-btn {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
}

.drawer-close-btn:hover {
  color: var(--color-text);
  background: rgba(255,255,255,0.08);
}

/* Drawer search */
.drawer-search {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border-light);
  flex-shrink: 0;
}

.drawer-search-inner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--color-dark-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  transition: border-color 0.2s;
}

.drawer-search-inner:focus-within {
  border-color: var(--color-primary);
}

.drawer-search-inner svg {
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.drawer-search-inner input {
  flex: 1;
  min-width: 0;
  width: 0;
  background: none;
  border: none;
  outline: none;
  color: var(--color-text);
  font-size: 0.9rem;
  font-family: var(--font-family);
  -webkit-appearance: none;
  appearance: none;
}

.drawer-search-inner input::placeholder {
  color: var(--color-text-muted);
}
.drawer-search-inner input::-webkit-search-decoration,
.drawer-search-inner input::-webkit-search-cancel-button { display: none; }

/* Drawer nav */
.drawer-nav {
  flex: 1;
  padding: 0.75rem 0;
}

.drawer-nav-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  padding: 0.5rem 1.25rem 0.25rem;
  margin: 0;
}

.drawer-nav-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.85rem 1.25rem;
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  border-left: 2px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.drawer-nav-item svg {
  color: var(--color-text-muted);
  flex-shrink: 0;
  transition: color 0.15s;
}

.drawer-nav-item:hover,
.drawer-nav-item.active {
  background: rgba(212,175,55,0.05);
  border-left-color: var(--color-primary);
  color: var(--color-primary);
}

.drawer-nav-item:hover svg,
.drawer-nav-item.active svg {
  color: var(--color-primary);
}

/* Drawer account actions */
.drawer-account {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex-shrink: 0;
}

.drawer-account-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: rgba(255,255,255,0.03);
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
  cursor: pointer;
  font-family: var(--font-family);
  width: 100%;
  text-align: left;
}

.drawer-account-btn svg { color: var(--color-text-muted); }

.drawer-account-btn:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.15);
}

.drawer-account-btn.primary {
  background: rgba(212,175,55,0.1);
  border-color: rgba(212,175,55,0.3);
  color: var(--color-primary);
}

.drawer-account-btn.primary svg { color: var(--color-primary); }

.drawer-account-btn.primary:hover {
  background: rgba(212,175,55,0.18);
}

.drawer-logout-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(198,40,40,0.25);
  background: rgba(198,40,40,0.06);
  color: #ef9a9a;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-family);
  width: 100%;
  text-align: left;
  transition: background 0.15s;
}

.drawer-logout-btn svg { color: #ef9a9a; }
.drawer-logout-btn:hover { background: rgba(198,40,40,0.12); }

/* ─── Responsive ─── */

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
  }

  .mobile-drawer-overlay {
    display: block;
    pointer-events: none;
  }

  .mobile-drawer-overlay.open {
    pointer-events: all;
  }

  .site-main {
    padding-bottom: 64px;
  }

  .site-footer {
    margin-bottom: 64px;
  }
}

@media (max-width: 360px) {
  .bnav-label {
    font-size: 0.56rem;
  }
}
