/* ==========================================================================
   Synergreens storefront — mobile drawers: account (#profile-menu),
   shopping cart (#headerTopCartDropdown), and categories (#bottom-nav).
   Ultra-premium, native-app style panels. Teal brand theme.
   Shared chrome (close button, pill CTA system, variables) is scoped to
   all three IDs; each drawer also has its own bespoke content classes
   (.sg-drawer__* for the account drawer, .sg-cart__* for the cart,
   .sg-cat__* for categories).
   Everything is ID-scoped so it cannot affect the shared
   .header-nav-features-dropdown.side-bar/.cart-bar base or any other
   component.
   ========================================================================== */

#profile-menu.sg-drawer,
#headerTopCartDropdown.sg-drawer,
#bottom-nav.sg-drawer {
  --sg-drawer-royal: #04878b;
  --sg-drawer-royal-deep: #01393a;
  --sg-drawer-royal-soft: #e7f4f4;
  --sg-drawer-ink: #0f2a2b;
  --sg-drawer-muted: #6b7590;
  --sg-drawer-line: rgba(4, 135, 139, 0.1);
  font-family: "Poppins", sans-serif;
  overflow: hidden !important;
  padding: 0 !important;
  row-gap: 0 !important;
}
#profile-menu.sg-drawer,
#bottom-nav.sg-drawer {
  display: block !important;
  background: linear-gradient(180deg, var(--sg-drawer-royal-soft) 0%, #ffffff 300px);
}
#headerTopCartDropdown.sg-drawer {
  /* display:flex; flex-direction:column already inherited from the base
     .header-nav-features-dropdown rule — perfect for a
     [scrollable items][pinned footer] native cart layout. */
  background: linear-gradient(180deg, var(--sg-drawer-royal-soft) 0%, #ffffff 170px);
}

#profile-menu.sg-drawer.show,
#headerTopCartDropdown.sg-drawer.show,
#bottom-nav.sg-drawer.show {
  z-index: 10100 !important;
}

/* ---------- Inner scroll surface -------------------------------------- */
/* The base theme forces overflow:auto on the drawer itself; we take
   control by scrolling an inner layer instead, so the close button (and,
   for the cart, the checkout footer) can stay pinned regardless of
   scroll position. */
#profile-menu.sg-drawer .sg-drawer__scroll,
#bottom-nav.sg-drawer .sg-drawer__scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  row-gap: 14px;
  padding: 56px 18px calc(72px + env(safe-area-inset-bottom, 0px));
}
/* Guest and profile cards use overflow:hidden, which lets a flex column
   shrink them below their content. On shorter phones that clips Login
   and Register. Keep every block at its natural height and scroll instead. */
#profile-menu.sg-drawer .sg-drawer__scroll > * {
  flex: 0 0 auto;
}

#bottom-nav.sg-drawer .sg-drawer__scroll::after {
  content: "";
  display: block;
  flex: 0 0 auto;
  height: 12px;
  pointer-events: none;
}
#headerTopCartDropdown.sg-drawer .sg-drawer__scroll {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 56px 16px 18px;
}

/* ---------- Floating close button (shared) ------------------------------ */
#profile-menu.sg-drawer .sg-drawer__close,
#headerTopCartDropdown.sg-drawer .sg-drawer__close,
#bottom-nav.sg-drawer .sg-drawer__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  color: var(--sg-drawer-royal-deep);
  font-size: 15px;
  box-shadow: 0 6px 16px rgba(1, 57, 58, 0.18);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
#profile-menu.sg-drawer .sg-drawer__close:hover,
#headerTopCartDropdown.sg-drawer .sg-drawer__close:hover,
#bottom-nav.sg-drawer .sg-drawer__close:hover {
  background: var(--sg-drawer-royal);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(4, 135, 139, 0.32);
  transform: rotate(90deg);
}
#profile-menu.sg-drawer .sg-drawer__close:focus-visible,
#headerTopCartDropdown.sg-drawer .sg-drawer__close:focus-visible,
#bottom-nav.sg-drawer .sg-drawer__close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(4, 135, 139, 0.35);
}

/* ---------- Logged-in profile card -------------------------------------- */
#profile-menu.sg-drawer .sg-drawer__profile {
  position: relative;
  padding: 22px 18px 18px;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--sg-drawer-royal) 0%, var(--sg-drawer-royal-deep) 100%);
  box-shadow: 0 18px 34px rgba(1, 57, 58, 0.28);
}
#profile-menu.sg-drawer .sg-drawer__profile-glow {
  position: absolute;
  top: -46px;
  right: -32px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 70%);
  pointer-events: none;
}
#profile-menu.sg-drawer .sg-drawer__profile-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
}
#profile-menu.sg-drawer .sg-drawer__avatar-ring {
  position: relative;
  flex: 0 0 auto;
  width: 60px;
  height: 60px;
  padding: 3px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffffff, rgba(255, 255, 255, 0.35));
}
#profile-menu.sg-drawer .sg-drawer__avatar {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #ffffff;
}
#profile-menu.sg-drawer .sg-drawer__avatar-status {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #2ecc71;
  border: 3px solid var(--sg-drawer-royal-deep);
}
#profile-menu.sg-drawer .sg-drawer__profile-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
#profile-menu.sg-drawer .sg-drawer__eyebrow {
  align-self: flex-start;
  margin-bottom: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #d7f3f3;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
#profile-menu.sg-drawer .sg-drawer__name {
  display: block;
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#profile-menu.sg-drawer .sg-drawer__email {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#profile-menu.sg-drawer .sg-drawer__profile-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

/* ---------- Shared pill CTA buttons -------------------------------------- */
#profile-menu.sg-drawer .sg-drawer__cta,
#headerTopCartDropdown.sg-drawer .sg-drawer__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-decoration: none !important;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
#profile-menu.sg-drawer .sg-drawer__cta:active,
#headerTopCartDropdown.sg-drawer .sg-drawer__cta:active {
  transform: scale(0.96);
}
#profile-menu.sg-drawer .sg-drawer__cta:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.55);
}
#headerTopCartDropdown.sg-drawer .sg-drawer__cta:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(4, 135, 139, 0.35);
}
#profile-menu.sg-drawer .sg-drawer__cta--solid {
  flex: 1 1 auto;
  background: #ffffff;
  color: var(--sg-drawer-royal-deep);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
}
#profile-menu.sg-drawer .sg-drawer__cta--solid:hover {
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
}
#profile-menu.sg-drawer .sg-drawer__cta--ghost {
  flex: 0 0 auto;
  width: 44px;
  padding: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.32);
}
#profile-menu.sg-drawer .sg-drawer__cta--ghost:hover {
  background: rgba(255, 255, 255, 0.24);
}
#profile-menu.sg-drawer .sg-drawer__cta--ghost-wide {
  flex: 1 1 0;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
}
#profile-menu.sg-drawer .sg-drawer__cta--ghost-wide:hover {
  background: rgba(255, 255, 255, 0.24);
}
#profile-menu.sg-drawer .sg-drawer__cta--solid-wide {
  flex: 1 1 0;
  background: #ffffff;
  color: var(--sg-drawer-royal-deep);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
}
#profile-menu.sg-drawer .sg-drawer__cta--solid-wide:hover {
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
}

/* ---------- Cart-only CTA variants (light background) -------------------- */
#headerTopCartDropdown.sg-drawer .sg-drawer__cta--primary {
  width: 100%;
  background: linear-gradient(135deg, var(--sg-drawer-royal) 0%, var(--sg-drawer-royal-deep) 100%);
  color: #ffffff;
  box-shadow: 0 12px 22px rgba(4, 135, 139, 0.32);
}
#headerTopCartDropdown.sg-drawer .sg-drawer__cta--primary:hover {
  box-shadow: 0 14px 26px rgba(4, 135, 139, 0.4);
}
#headerTopCartDropdown.sg-drawer .sg-drawer__cta--secondary {
  width: 100%;
  background: #ffffff;
  color: var(--sg-drawer-royal-deep);
  border: 1.5px solid var(--sg-drawer-line);
}
#headerTopCartDropdown.sg-drawer .sg-drawer__cta--secondary:hover {
  background: var(--sg-drawer-royal-soft);
  border-color: rgba(4, 135, 139, 0.24);
}

/* ---------- Guest card -------------------------------------------------- */
#profile-menu.sg-drawer .sg-drawer__guest {
  position: relative;
  padding: 26px 20px 22px;
  border-radius: 22px;
  overflow: hidden;
  text-align: center;
  background: linear-gradient(135deg, var(--sg-drawer-royal) 0%, var(--sg-drawer-royal-deep) 100%);
  box-shadow: 0 18px 34px rgba(1, 57, 58, 0.28);
}
#profile-menu.sg-drawer .sg-drawer__guest-glow {
  position: absolute;
  top: -50px;
  left: -34px;
  width: 165px;
  height: 165px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent 70%);
  pointer-events: none;
}
#profile-menu.sg-drawer .sg-drawer__guest-icon {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
  font-size: 20px;
}
#profile-menu.sg-drawer .sg-drawer__guest-title {
  position: relative;
  z-index: 1;
  display: block;
  margin-bottom: 6px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
}
#profile-menu.sg-drawer .sg-drawer__guest-copy {
  position: relative;
  z-index: 1;
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  line-height: 1.5;
}
#profile-menu.sg-drawer .sg-drawer__guest-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
}

/* ---------- Nav list ----------------------------------------------------- */
#profile-menu.sg-drawer .sg-drawer__nav {
  margin-top: 4px;
}
#profile-menu.sg-drawer .sg-drawer__nav-label {
  display: block;
  margin: 0 6px 10px;
  color: var(--sg-drawer-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
#profile-menu.sg-drawer .sg-drawer__nav-list {
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}
#profile-menu.sg-drawer .sg-drawer__nav-item {
  border-bottom: 1px solid var(--sg-drawer-line);
}
#profile-menu.sg-drawer .sg-drawer__nav-item:last-child {
  border-bottom: 0;
}
#profile-menu.sg-drawer .sg-drawer__nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 14px;
  border-radius: 14px;
  color: var(--sg-drawer-ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
  transition: background-color 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
}
#profile-menu.sg-drawer .sg-drawer__nav-link:hover,
#profile-menu.sg-drawer .sg-drawer__nav-link:active {
  background: var(--sg-drawer-royal-soft);
}
#profile-menu.sg-drawer .sg-drawer__nav-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5f5;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
#profile-menu.sg-drawer .sg-drawer__nav-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#profile-menu.sg-drawer .sg-drawer__nav-chevron {
  flex: 0 0 auto;
  color: #cbd5e1;
  font-size: 11px;
  transition: color 0.2s ease;
}
#profile-menu.sg-drawer .sg-drawer__nav-item.is-active .sg-drawer__nav-link {
  background: var(--sg-drawer-royal-soft);
  color: var(--sg-drawer-royal-deep);
  padding-left: 18px;
}
#profile-menu.sg-drawer .sg-drawer__nav-item.is-active .sg-drawer__nav-dot {
  background: var(--sg-drawer-royal);
  transform: scale(1.25);
  box-shadow: 0 0 0 4px rgba(4, 135, 139, 0.15);
}
#profile-menu.sg-drawer .sg-drawer__nav-item.is-active .sg-drawer__nav-chevron {
  color: var(--sg-drawer-royal);
}

/* ---------- Footer brand tag --------------------------------------------- */
#profile-menu.sg-drawer .sg-drawer__footer {
  margin-top: auto;
  padding-top: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
#profile-menu.sg-drawer .sg-drawer__footer-logo {
  height: 20px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  opacity: 0.85;
}
#profile-menu.sg-drawer .sg-drawer__footer-tag {
  color: var(--sg-drawer-muted);
  font-size: 10.5px;
  letter-spacing: 0.03em;
}

/* ---------- Entrance choreography (native-app feel) ---------------------- */
@keyframes sgDrawerRise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
#profile-menu.sg-drawer.show .sg-drawer__profile,
#profile-menu.sg-drawer.show .sg-drawer__guest {
  animation: sgDrawerRise 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}
#profile-menu.sg-drawer.show .sg-drawer__nav-label,
#profile-menu.sg-drawer.show .sg-drawer__nav-list {
  animation: sgDrawerRise 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 0.06s;
}
#profile-menu.sg-drawer.show .sg-drawer__nav-item {
  animation: sgDrawerRise 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(0.1s + (var(--sg-drawer-i, 0) * 0.045s));
}
#profile-menu.sg-drawer.show .sg-drawer__footer {
  animation: sgDrawerRise 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 0.22s;
}

@media (prefers-reduced-motion: reduce) {
  #profile-menu.sg-drawer .sg-drawer__close,
  #profile-menu.sg-drawer .sg-drawer__cta,
  #profile-menu.sg-drawer.show .sg-drawer__profile,
  #profile-menu.sg-drawer.show .sg-drawer__guest,
  #profile-menu.sg-drawer.show .sg-drawer__nav-label,
  #profile-menu.sg-drawer.show .sg-drawer__nav-list,
  #profile-menu.sg-drawer.show .sg-drawer__nav-item,
  #profile-menu.sg-drawer.show .sg-drawer__footer,
  #headerTopCartDropdown.sg-drawer .sg-drawer__close,
  #headerTopCartDropdown.sg-drawer .sg-drawer__cta,
  #headerTopCartDropdown.sg-drawer.show .sg-cart__head,
  #headerTopCartDropdown.sg-drawer.show .sg-cart__list .product-item,
  #bottom-nav.sg-drawer .sg-drawer__close,
  #bottom-nav.sg-drawer.show .sg-cat__head,
  #bottom-nav.sg-drawer.show .sg-cat__group,
  #bottom-nav.sg-drawer.show .sg-cat__item {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 360px) {
  #profile-menu.sg-drawer .sg-drawer__scroll,
  #headerTopCartDropdown.sg-drawer .sg-drawer__scroll,
  #bottom-nav.sg-drawer .sg-drawer__scroll {
    padding-left: 14px;
    padding-right: 14px;
  }
}

/* ==========================================================================
   Shopping cart drawer (#headerTopCartDropdown) — bespoke content classes.
   Item markup itself (.product-item/.product-detail/.product-thumb/...) is
   generated server-side by getCartItemDropdown() and re-injected by the
   existing add/remove AJAX flows — we restyle those exact classnames here
   (ID-scoped) instead of touching the PHP/JS, so cart functionality
   (add/remove/quantity totals) is completely untouched.
   ========================================================================== */

/* ---------- Header ------------------------------------------------------- */
#headerTopCartDropdown.sg-drawer .sg-cart__head {
  padding-bottom: 16px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--sg-drawer-line);
}
#headerTopCartDropdown.sg-drawer .sg-cart__eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--sg-drawer-royal);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
#headerTopCartDropdown.sg-drawer .sg-cart__heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--sg-drawer-ink);
  font-size: 19px;
  font-weight: 700;
}
#headerTopCartDropdown.sg-drawer .sg-cart__count-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--sg-drawer-royal-soft);
  color: var(--sg-drawer-royal-deep);
  font-size: 11px;
  font-weight: 700;
}

/* ---------- Item list ----------------------------------------------------- */
#headerTopCartDropdown.sg-drawer .sg-cart__list {
  display: flex;
  flex-direction: column;
  row-gap: 10px;
}
#headerTopCartDropdown.sg-drawer .product-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  margin: 0;
  border: 0;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.07);
}
#headerTopCartDropdown.sg-drawer .product-detail {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
}
#headerTopCartDropdown.sg-drawer .product-detail .product-thumb {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  max-width: 56px;
  margin-right: 12px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--sg-drawer-royal-soft);
  box-shadow: inset 0 0 0 1px var(--sg-drawer-line);
}
#headerTopCartDropdown.sg-drawer .product-detail .product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#headerTopCartDropdown.sg-drawer .product-detail > .item-wrapper {
  display: flex;
  flex-direction: column;
  row-gap: 4px;
  min-width: 0;
}
#headerTopCartDropdown.sg-drawer .product-detail .product-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--sg-drawer-ink);
  font-size: 13.5px;
  font-weight: 600;
}
#headerTopCartDropdown.sg-drawer .product-detail > .item-wrapper > .item-wrapper {
  display: flex;
  align-items: center;
  column-gap: 8px;
}
#headerTopCartDropdown.sg-drawer .product-detail .product-qnty {
  padding: 1px 8px;
  border-radius: 999px;
  background: #f1f4fb;
  color: var(--sg-drawer-muted);
  font-size: 11px;
  font-weight: 600;
}
#headerTopCartDropdown.sg-drawer .product-detail .product-price {
  color: var(--sg-drawer-royal-deep);
  font-size: 13px;
  font-weight: 700;
}
#headerTopCartDropdown.sg-drawer .cart-edit {
  flex: 0 0 auto;
}
#headerTopCartDropdown.sg-drawer .cart-edit .item-wrapper {
  display: flex;
}
#headerTopCartDropdown.sg-drawer .product-thumbnail-remove.del-item-cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f4f5f9;
  color: var(--sg-drawer-muted);
  opacity: 1;
  transition: background-color 0.2s ease, color 0.2s ease;
}
#headerTopCartDropdown.sg-drawer .product-thumbnail-remove.del-item-cart:hover {
  background: #fdecec;
  color: #e0473e;
  opacity: 1;
}
#headerTopCartDropdown.sg-drawer .product-thumbnail-remove.del-item-cart i {
  font-size: 12px;
}

/* Empty-cart state: the PHP fallback renders a single .product-detail with
   no .cart-edit sibling — :only-child reliably targets just that case. */
#headerTopCartDropdown.sg-drawer .product-item:has(> .product-detail:only-child) {
  background: transparent;
  box-shadow: none;
  padding: 40px 10px;
}
#headerTopCartDropdown.sg-drawer .product-detail:only-child {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  color: var(--sg-drawer-muted);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}
#headerTopCartDropdown.sg-drawer .product-detail:only-child::before {
  content: "🛒";
  display: block;
  margin-bottom: 10px;
  font-size: 34px;
  line-height: 1;
}

/* ---------- Pinned footer (total + checkout CTAs) ------------------------ */
#headerTopCartDropdown.sg-drawer .sg-cart__footer {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  row-gap: 10px;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  background: #ffffff;
  box-shadow: 0 -12px 24px rgba(15, 23, 42, 0.06);
}

/* The glass dock now slides away whenever any drawer is open
   (html.sg-drawer-open), so this footer can sit on the true bottom
   edge. Keep only the device home-indicator inset. */
#headerTopCartDropdown.sg-drawer .sg-cart__total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 2px;
}
#headerTopCartDropdown.sg-drawer .sg-cart__total-label {
  color: var(--sg-drawer-muted);
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
#headerTopCartDropdown.sg-drawer .sg-cart__total-amount {
  display: inline-block;
  color: var(--sg-drawer-ink);
  font-size: 20px;
  font-weight: 700;
}

/* ---------- Entrance choreography ----------------------------------------- */
#headerTopCartDropdown.sg-drawer.show .sg-cart__head {
  animation: sgDrawerRise 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
#headerTopCartDropdown.sg-drawer.show .sg-cart__list .product-item {
  animation: sgDrawerRise 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 0.05s;
}

/* ==========================================================================
   Categories drawer (#bottom-nav) — bespoke content classes.
   Categories are fetched server-side (jos_product_sales_categories) and
   the Package Categories rows are static links — none of this is
   AJAX-managed, so both the wrapper and generated item markup are fully
   restyled/restructured here alongside the matching PHP template edit.
   ========================================================================== */

#bottom-nav.sg-drawer .sg-cat__head {
  padding-bottom: 16px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--sg-drawer-line);
}
#bottom-nav.sg-drawer .sg-cat__eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--sg-drawer-royal);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
#bottom-nav.sg-drawer .sg-cat__heading {
  margin: 0;
  color: var(--sg-drawer-ink);
  font-size: 19px;
  font-weight: 700;
}

/* ---------- Section groups (dynamic categories + Package Categories) ---- */
#bottom-nav.sg-drawer .sg-cat__group {
  margin-bottom: 4px;
}
#bottom-nav.sg-drawer .sg-cat__group:last-child {
  margin-bottom: 0;
  padding-bottom: 8px;
}
#bottom-nav.sg-drawer .sg-cat__group:last-child .sg-cat__group-body {
  margin-bottom: 0;
}
#bottom-nav.sg-drawer .sg-cat__group-head {
  margin: 0 2px 8px;
}
#bottom-nav.sg-drawer .sg-cat__group-title {
  margin: 0;
  color: var(--sg-drawer-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
#bottom-nav.sg-drawer .sg-cat__group-body {
  display: flex;
  flex-direction: column;
  row-gap: 6px;
  padding: 6px;
  margin: 0 0 18px;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

/* ---------- Category rows ------------------------------------------------ */
#bottom-nav.sg-drawer .sg-cat__item {
  border-radius: 14px;
}
#bottom-nav.sg-drawer .sg-cat__item-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 0 14px;
  border-radius: 14px;
  color: var(--sg-drawer-ink);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none !important;
  transition: background-color 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
}
#bottom-nav.sg-drawer .sg-cat__item-link:hover,
#bottom-nav.sg-drawer .sg-cat__item-link:active {
  background: var(--sg-drawer-royal-soft);
  text-decoration: none;
}
#bottom-nav.sg-drawer .sg-cat__item-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cbd5f5;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
#bottom-nav.sg-drawer .sg-cat__item-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#bottom-nav.sg-drawer .sg-cat__item-chevron {
  flex: 0 0 auto;
  color: #cbd5e1;
  font-size: 10.5px;
  transition: color 0.2s ease;
}
#bottom-nav.sg-drawer .sg-cat__item.is-active .sg-cat__item-link {
  background: var(--sg-drawer-royal-soft);
  color: var(--sg-drawer-royal-deep);
  padding-left: 18px;
}
#bottom-nav.sg-drawer .sg-cat__item.is-active .sg-cat__item-dot {
  background: var(--sg-drawer-royal);
  transform: scale(1.25);
  box-shadow: 0 0 0 4px rgba(4, 135, 139, 0.15);
}
#bottom-nav.sg-drawer .sg-cat__item.is-active .sg-cat__item-chevron {
  color: var(--sg-drawer-royal);
}

/* Parent rows that have their own sub-list (no chevron, expands below) */
#bottom-nav.sg-drawer .sg-cat__item--parent .sg-cat__item-link {
  font-weight: 700;
}

/* ---------- Nested sub-list (grandchild categories) ---------------------- */
#bottom-nav.sg-drawer .sg-cat__sublist {
  margin: 0 6px 8px 30px;
  padding: 4px 0 0;
  list-style: none;
  border-left: 2px solid var(--sg-drawer-line);
}
#bottom-nav.sg-drawer .sg-cat__subitem {
  margin: 0;
}
#bottom-nav.sg-drawer .sg-cat__subitem-link {
  display: block;
  padding: 8px 0 8px 14px;
  color: var(--sg-drawer-muted);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none !important;
  transition: color 0.2s ease;
}
#bottom-nav.sg-drawer .sg-cat__subitem-link:hover {
  color: var(--sg-drawer-royal-deep);
  text-decoration: none;
}
#bottom-nav.sg-drawer .sg-cat__subitem.is-active .sg-cat__subitem-link {
  color: var(--sg-drawer-royal-deep);
  font-weight: 700;
}

/* ---------- Entrance choreography ----------------------------------------- */
#bottom-nav.sg-drawer.show .sg-cat__head {
  animation: sgDrawerRise 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
#bottom-nav.sg-drawer.show .sg-cat__group {
  animation: sgDrawerRise 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(0.06s + (var(--sg-drawer-i, 0) * 0.05s));
}

/* Panel slide: spring in from the right, like a native sheet.
   right stays 0 so the motion is a GPU transform, not a layout shift. */
#profile-menu.sg-drawer,
#headerTopCartDropdown.sg-drawer,
#bottom-nav.sg-drawer {
  right: 0 !important;
  border-radius: 28px 0 0 28px;
  box-shadow: -28px 0 70px rgba(1, 22, 24, 0.28) !important;
  transform: translate3d(108%, 0, 0);
  transition: transform 0.52s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.52s ease !important;
  will-change: transform;
}
#profile-menu.sg-drawer.show,
#headerTopCartDropdown.sg-drawer.show,
#bottom-nav.sg-drawer.show {
  transform: translate3d(0, 0, 0);
}

#anywhere-home.bgshow {
  background: rgba(1, 22, 24, 0.48);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

@media (prefers-reduced-motion: reduce) {
  #profile-menu.sg-drawer,
  #headerTopCartDropdown.sg-drawer,
  #bottom-nav.sg-drawer {
    transition: none !important;
  }
}
