/* Mega menu – Sleep / Sit / Relax: group panel only */
@media (min-width: 992px) {
  .mega-menu {
    overflow: hidden !important;
  }

  /* Final desktop lock: no right preview image */
  .mega-preview,
  .mega-menu .mega-preview {
    display: none !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    overflow: hidden !important;
  }

  .mega-menu .container {
    max-width: 1240px;
  }

  .mega-menu-inner.mega-menu-rich {
    grid-template-columns: 220px minmax(0, 1fr) !important;
    min-height: 330px;
    max-height: 74vh;
    padding-top: 14px;
    overflow: hidden;
  }

  .mega-sidebar {
    display: block !important;
    padding: 0 10px 0 0;
    border-right: 1px solid rgba(201, 162, 39, 0.22);
    max-height: calc(74vh - 90px);
    overflow-y: auto;
    overflow-x: hidden;
  }

  .mega-sidebar .mega-side-link {
    padding: 10px 12px;
    margin-bottom: 3px;
    border-radius: 10px;
    font-size: 0.9rem;
  }

  .mega-detail-area {
    min-height: 300px;
    max-height: calc(74vh - 70px);
    padding: 0 16px 16px 18px !important;
    overflow: hidden;
  }

  .mega-product-links {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px 18px;
    max-width: 100%;
  }

  .mega-product-link {
    padding: 8px 0;
    font-size: 0.88rem;
  }

  .mega-menu-footer {
    padding: 10px 16px;
  }

  .mega-detail-panel,
  .mega-panel-groups,
  .mega-panel-category {
    position: relative !important;
    inset: auto !important;
    min-height: auto !important;
    max-height: calc(74vh - 90px);
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding-right: 4px;
  }

  .mega-menu-inner.mega-menu-group-only {
    grid-template-columns: 1fr !important;
    overflow: hidden;
  }

  .mega-menu-inner.mega-menu-group-only #mega-sidebar,
  .mega-menu-inner.mega-menu-group-only .mega-sidebar {
    display: none !important;
  }

  .mega-menu-inner.mega-menu-group-only .mega-detail-area {
    padding-left: 28px;
    padding-right: 28px;
    min-width: 0;
    overflow: hidden;
  }

  .mega-menu-inner.mega-menu-group-only .mega-preview {
    display: none !important;
  }

  .mega-menu-inner.mega-menu-group-only .mega-panel-groups.active {
    position: relative;
    inset: auto;
    width: 100%;
  }

  .mega-menu-inner.mega-menu-group-only .mega-col-grid-wide {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

/* Cart badge */
.site-header .header-actions .icon-btn,
.mobile-bottom-nav .mbn-item.mbn-cart {
  position: relative;
}

.site-header .header-actions #cart-badge,
#mobile-cart-badge {
  display: none;
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #5c4f20;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(30, 58, 95, 0.35);
  z-index: 2;
}

.site-header .header-actions #cart-badge.cart-has-items,
#mobile-cart-badge.cart-has-items {
  display: block;
}

.mobile-bottom-nav #mobile-cart-badge {
  top: 0;
  right: 8px;
}

/* Account avatar in header */
.site-header .icon-btn.has-avatar {
  padding: 0;
  overflow: hidden;
  border-radius: 50%;
}

.site-header .icon-btn .account-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.account-wrap {
  position: relative;
}

.account-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid #e8eef5;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(74, 63, 26, 0.14);
  padding: 8px;
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  display: block;
}

.account-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.account-dropdown a {
  display: block;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #4a3f1a;
  text-decoration: none;
}

.account-dropdown a:hover {
  background: #fffdf5;
  color: #5c4f20;
}

.account-dropdown .account-dropdown-head {
  padding: 10px 14px 8px;
  border-bottom: 1px solid #faf6ed;
  margin-bottom: 4px;
}

.account-dropdown .account-dropdown-head strong {
  display: block;
  font-size: 0.88rem;
  color: #4a3f1a;
}

.account-dropdown .account-dropdown-head span {
  font-size: 0.75rem;
  color: #64748b;
}

/* Mobile account sheet */
.mobile-account-sheet {
  position: fixed;
  inset: 0;
  z-index: 2100;
  pointer-events: none;
  visibility: hidden;
}

.mobile-account-sheet.open {
  pointer-events: auto;
  visibility: visible;
}

.mobile-account-sheet .mas-overlay {
  position: absolute;
  inset: 0;
  background: rgba(74, 63, 26, 0.45);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.mobile-account-sheet.open .mas-overlay {
  opacity: 1;
}

.mobile-account-sheet .mas-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.mobile-account-sheet.open .mas-panel {
  transform: translateY(0);
}

.mas-user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #faf6ed;
}

.mas-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: #fef8ea;
}

.mas-avatar-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fef8ea;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5c4f20;
}

.mas-links a {
  display: block;
  padding: 14px 12px;
  font-weight: 600;
  color: #4a3f1a;
  text-decoration: none;
  border-radius: 12px;
}

.mas-links a:hover {
  background: #f8fbfe;
}

.mobile-bottom-nav .mbn-item .mbn-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(201, 162, 39, 0.4);
}

/* Global toast (success / error / info) */
.gt-toast {
  position: fixed;
  top: 88px;
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  max-width: min(92vw, 400px);
  padding: 14px 20px;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  z-index: 5000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 10px 32px rgba(74, 63, 26, 0.18);
  color: #fff;
}

.gt-toast[hidden] {
  display: block;
}

.gt-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.gt-toast--success {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.gt-toast--error {
  background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.gt-toast--warning {
  background: linear-gradient(135deg, #b45309 0%, #d97706 100%);
}

.gt-toast--info {
  background: linear-gradient(135deg, #4a3f1a 0%, #6b5a20 100%);
}

@media (min-width: 992px) {
  .gt-toast {
    top: 24px;
  }
}

@media (max-width: 991.98px) {
  .page-account .gt-toast {
    top: 72px;
  }
}
