.catalog-layout-switcher {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
}

.layout-btn {
  min-height: 40px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-weight: var(--font-weight-bold, 700);
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.layout-btn svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.layout-btn span {
  white-space: nowrap;
}

.layout-btn.active {
  border-color: var(--primary-color);
  background: color-mix(in srgb, var(--primary-color) 12%, white);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary-color) 30%, white);
}

.layout-btn:hover {
  transform: translateY(-1px);
  border-color: var(--primary-color);
}

.layout-btn:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary-color) 28%, white);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .catalog-layout-switcher {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .layout-btn {
    justify-content: center;
  }
}
