/* Tabbed megamenu */

.tabbed-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  color: var(--color-text);
}

.tabbed-trigger:active {
  background: var(--color-accent-soft);
}

.tabbed-trigger svg {
  width: 22px;
  height: 22px;
}

.tabbed-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--color-overlay);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}

.tabbed-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.tabbed-panel {
  position: fixed;
  inset: 0;
  z-index: 101;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
}

.tabbed-panel.is-open {
  transform: translateY(0);
}

.tabbed-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 8px 0 16px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.tabbed-panel__title {
  font-weight: 700;
  font-size: 1.05rem;
}

.tabbed-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
}

.tabbed-close:active {
  background: var(--color-accent-soft);
  color: var(--color-text);
}

.tabbed-close svg {
  width: 22px;
  height: 22px;
}

/* Horizontal scrollable category tabs */
.tabbed-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.tabbed-tabs::-webkit-scrollbar {
  display: none;
}

.tabbed-tab {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-bg);
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.tabbed-tab.is-active {
  color: var(--color-accent);
  background: var(--color-accent-soft);
  border-color: rgba(45, 106, 79, 0.25);
}

.tabbed-panel__body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: calc(16px + var(--safe-bottom));
}

.tabbed-pane {
  display: none;
}

.tabbed-pane.is-active {
  display: block;
}
