/* ===== SLOTH — Submenu / Tab Navigation ===== */

/* Elrendezés: a .submenu-container::before viszi a teljes szélességű csíkot, a .submenu-wrapper görget. */

.submenu-container {
  overflow-x: visible;
  position: relative;
  isolation: isolate;
  margin-top: calc(-1 * var(--page-pad-top));
  margin-bottom: var(--page-submenu-gap);
  background: transparent;
  transition: background-color var(--ease-base), border-color var(--ease-base);
}

/* Teljes szélességű háttércsík: szimmetrikus -100vw kifutás, NEM `left: 50%` (frontend.md). */
.submenu-container::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -100vw;
  right: -100vw;
  width: auto;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  z-index: -1;
  transition: background-color var(--ease-base), border-color var(--ease-base);
}

.submenu-wrapper {
  display: flex;
  position: relative;
  box-sizing: border-box;
  overflow-x: auto;
  white-space: nowrap;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.submenu-wrapper::-webkit-scrollbar {
  display: none;
}

.submenu-item {
  flex: 1 1 0;
  padding: var(--space-3) var(--space-4);
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: var(--text-sm);
  position: relative;
  text-align: center;
  white-space: nowrap;
  transition: color var(--ease-fast), background var(--ease-fast);
  cursor: pointer;
  border-radius: 0;
}

.submenu-item:hover {
  color: var(--text-secondary);
  background: var(--bg-surface);
  box-shadow: inset 0 -1px 0 var(--border);
}

.submenu-item.active {
  color: var(--clr-green);
  font-weight: 600;
}

.submenu-item.active::after {
  content: '';
  display: block;
  height: 2px;
  background-color: var(--clr-green);
  width: 100%;
  position: absolute;
  bottom: 0;
  left: 0;
  border-radius: var(--radius-full) var(--radius-full) 0 0;
}

.submenu-form {
  cursor: pointer;
}

.submenu-form button {
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  cursor: pointer;
  padding: 0;
  pointer-events: none;
}

/* Disable browser swipe-back/forward on pages with a submenu (PWA) */
body.has-submenu-page {
  overscroll-behavior-x: none;
}

.submenu-pending-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.3rem;
  border-radius: var(--radius-full);
  background: var(--clr-yellow);
  color: var(--text-inverse);
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1;
  margin-left: 0.3rem;
  vertical-align: middle;
}
