.tas-blog-toolbar {
  --tas-content-gutter: 20px;
  padding: 20px 0 28px;
  background: var(--white);
}

.tas-blog-toolbar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  width: min(100% - calc(var(--tas-content-gutter) * 2), var(--layout-max-width));
  margin: 0 auto;
}

.tas-blog-toolbar__filters-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}

.tas-blog-toolbar__filters-wrap::before,
.tas-blog-toolbar__filters-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 2px;
  z-index: 1;
  width: 28px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.tas-blog-toolbar__filters-wrap::before {
  left: 0;
  background: linear-gradient(90deg, var(--white) 0%, transparent 100%);
}

.tas-blog-toolbar__filters-wrap::after {
  right: 0;
  background: linear-gradient(270deg, var(--white) 0%, transparent 100%);
}

.tas-blog-toolbar__filters-wrap.is-scrollable::after {
  opacity: 1;
}

.tas-blog-toolbar__filters-wrap.is-scrollable:not(.is-at-start)::before {
  opacity: 1;
}

.tas-blog-toolbar__filters {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  min-width: 0;
  padding-bottom: 4px;
  scroll-padding-inline: 4px;
}

.tas-blog-toolbar__filters::-webkit-scrollbar {
  display: none;
}

.tas-blog-toolbar__pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  scroll-snap-align: start;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none !important;
  color: var(--text-muted) !important;
  background: transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.tas-blog-toolbar__pill:hover {
  color: var(--primary) !important;
  border-color: var(--border-light);
  background: var(--surface-hover);
}

.tas-blog-toolbar__pill.is-active {
  color: var(--text-on-primary) !important;
  background: var(--primary);
  border-color: var(--primary);
}

.tas-blog-toolbar__pill-icon,
.tas-blog-toolbar__pill-icon svg,
.tas-blog-toolbar__pill-icon .e-font-icon-svg {
  width: 0.875rem;
  height: 0.875rem;
  font-size: 0.875rem;
  line-height: 1;
  fill: currentColor;
}

.tas-blog-toolbar__search {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  width: min(100%, 260px);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  overflow: hidden;
  background: var(--white);
}

.tas-blog-toolbar__search-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 16px;
  border: none;
  background: transparent;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--text-body);
}

.tas-blog-toolbar__search-input:focus {
  outline: none;
}

.tas-blog-toolbar__search-input::placeholder {
  color: var(--text-muted);
}

.tas-blog-toolbar__search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border: none;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  transition: color 0.2s ease;
}

.tas-blog-toolbar__search-btn:hover {
  color: var(--primary-hover);
}

@media (max-width: 767px) {
  .tas-blog-toolbar {
    --tas-content-gutter: 16px;
    padding: 16px 0 20px;
  }

  .tas-blog-toolbar__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    width: 100%;
    max-width: none;
    padding: 0 var(--tas-content-gutter);
  }

  .tas-blog-toolbar__filters-wrap {
    width: calc(100% + var(--tas-content-gutter) * 2);
    max-width: none;
    margin-left: calc(-1 * var(--tas-content-gutter));
    margin-right: calc(-1 * var(--tas-content-gutter));
    padding-left: var(--tas-content-gutter);
    padding-right: var(--tas-content-gutter);
  }

  .tas-blog-toolbar__filters-wrap::before,
  .tas-blog-toolbar__filters-wrap::after {
    width: 24px;
  }

  .tas-blog-toolbar__filters {
    gap: 6px;
    padding-bottom: 2px;
  }

  .tas-blog-toolbar__pill {
    padding: 8px 14px;
    font-size: 0.75rem;
    gap: 6px;
  }

  .tas-blog-toolbar__pill-icon,
  .tas-blog-toolbar__pill-icon svg,
  .tas-blog-toolbar__pill-icon .e-font-icon-svg {
    width: 0.8125rem;
    height: 0.8125rem;
    font-size: 0.8125rem;
  }

  .tas-blog-toolbar__search {
    width: 100%;
  }
}
